From eaba521317f4b0f3a6aa67c8d0b5e270ad037f5c Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 9 Nov 2003 10:51:26 +0000 Subject: [PATCH] Don't change mixer if there's nothing to change. This caused a bug if the soundcard only supports one input and I cal... Original commit message from CVS: Don't change mixer if there's nothing to change. This caused a bug if the soundcard only supports one input and I call this function with rec=TRUE twice. --- sys/oss/gstossmixer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/oss/gstossmixer.c b/sys/oss/gstossmixer.c index 7b904ce838..7eb2e4b619 100644 --- a/sys/oss/gstossmixer.c +++ b/sys/oss/gstossmixer.c @@ -362,6 +362,11 @@ gst_ossmixer_set_record (GstMixer *mixer, g_return_if_fail (oss->mixer_fd != -1); g_return_if_fail (gst_ossmixer_contains_track (oss, osstrack)); + /* if there's nothing to do... */ + if ((record && GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_RECORD)) || + (!record && !GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_RECORD))) + return; + /* if we're exclusive, then we need to unset the current one(s) */ if (oss->mixcaps & SOUND_CAP_EXCL_INPUT) { GList *track;