pulsesink: Revise condition to set mute in the initial stage 83/266883/1 accepted/tizen/unified/20211123.020006 submit/tizen/20211122.082556
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 22 Nov 2021 04:49:39 +0000 (13:49 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 22 Nov 2021 05:13:16 +0000 (05:13 +0000)
If gst_pulseringbuffer_acquire() is called after _release() due
to any reason (e.g. caps changes), mute was not applied properly
with the current value. It is now fixed.

Note that the condition is slightly changed from upstream codes
especially on the mute_set variable.

Change-Id: I7b81160d12f30fbf1e872212b051adafeb2c50aa
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
ext/pulse/pulsesink.c

index 5ff0559..09e1444 100644 (file)
@@ -1103,9 +1103,8 @@ gst_pulseringbuffer_acquire (GstAudioRingBuffer * buf,
       goto no_index;
     if (psink->volume_set)
       gst_pulse_set_volume_ratio (idx, "out", psink->volume);
-    if (psink->mute_set)
-      if (psink->mute)
-        gst_pulse_set_volume_ratio (idx, "out", 0);
+    if (psink->mute)
+      gst_pulse_set_volume_ratio (idx, "out", 0);
   }
 #endif
   /* After we passed the volume off of to PA we never want to set it