From: <tp...@ke...> - 2008-05-27 16:11:40
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: tpm Date: Tue May 27 2008 16:11:46 UTC Log message: * ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_update_alsa_capabilities): Make sure playback volumes aren't accidentally overwritten by capture volumes if an alsa mixer track has both playback and capture capabilities: we create two GstMixerTracks in that case, so make sure we query only the alsa capabilities that refer to the type of GstMixerTrack we created from the dual capability alsa element. Should fix issues with Audigy2 sound cards (#518082). Modified files: . : ChangeLog ext/alsa : gstalsamixertrack.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.3969&r2=1.3970 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsamixertrack.c.diff?r1=1.18&r2=1.19 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.3969 retrieving revision 1.3970 diff -u -d -r1.3969 -r1.3970 --- ChangeLog 27 May 2008 10:57:55 -0000 1.3969 +++ ChangeLog 27 May 2008 16:11:31 -0000 1.3970 @@ -1,5 +1,17 @@ 2008-05-27 Tim-Philipp Müller <tim.muller at collabora co uk> + * ext/alsa/gstalsamixertrack.c: + (gst_alsa_mixer_track_update_alsa_capabilities): + Make sure playback volumes aren't accidentally overwritten by + capture volumes if an alsa mixer track has both playback and + capture capabilities: we create two GstMixerTracks in that + case, so make sure we query only the alsa capabilities that + refer to the type of GstMixerTrack we created from the dual + capability alsa element. Should fix issues with Audigy2 sound + cards (#518082). + +2008-05-27 Tim-Philipp Müller <tim.muller at collabora co uk> * tests/check/pipelines/oggmux.c: (test_pipeline): Don't use deprecated function. Index: gstalsamixertrack.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsamixertrack.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- gstalsamixertrack.c 3 Mar 2008 06:03:44 -0000 1.18 +++ gstalsamixertrack.c 27 May 2008 16:11:32 -0000 1.19 @@ -75,28 +75,40 @@ alsa_track->alsa_flags = 0; alsa_track->capture_group = -1; + /* common flags */ if (snd_mixer_selem_has_common_volume (alsa_track->element)) alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_VOLUME; - if (snd_mixer_selem_has_playback_volume (alsa_track->element)) - alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_PVOLUME; - - if (snd_mixer_selem_has_capture_volume (alsa_track->element)) - alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_CVOLUME; if (snd_mixer_selem_has_common_switch (alsa_track->element)) alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_SWITCH; - if (snd_mixer_selem_has_playback_switch (alsa_track->element)) - alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_PSWITCH; + /* Since we create two separate mixer track objects for alsa elements that + * support both playback and capture, we're going to 'hide' the alsa flags + * that don't pertain to this mixer track from alsa_flags, otherwise + * gst_alsa_mixer_track_update() is going to do things we don't want */ - if (snd_mixer_selem_has_capture_switch (alsa_track->element)) { - alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_CSWITCH; + /* playback flags */ + if ((GST_MIXER_TRACK (alsa_track)->flags & GST_MIXER_TRACK_OUTPUT)) { + if (snd_mixer_selem_has_playback_volume (alsa_track->element)) + alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_PVOLUME; - if (snd_mixer_selem_has_capture_switch_exclusive (alsa_track->element)) { - alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_CSWITCH_EXCL; - alsa_track->capture_group = - snd_mixer_selem_get_capture_group (alsa_track->element); + if (snd_mixer_selem_has_playback_switch (alsa_track->element)) + alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_PSWITCH; + } + /* capture flags */ + if ((GST_MIXER_TRACK (alsa_track)->flags & GST_MIXER_TRACK_INPUT)) { + if (snd_mixer_selem_has_capture_volume (alsa_track->element)) + alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_CVOLUME; + if (snd_mixer_selem_has_capture_switch (alsa_track->element)) { + alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_CSWITCH; + if (snd_mixer_selem_has_capture_switch_exclusive (alsa_track->element)) { + alsa_track->alsa_flags |= GST_ALSA_MIXER_TRACK_CSWITCH_EXCL; + alsa_track->capture_group = + snd_mixer_selem_get_capture_group (alsa_track->element); + } } } |