[vlc-devel] [PATCHES] -- aout fixes

brezhoneg1 brezhoneg1 at yahoo.fr
Wed Mar 20 02:22:11 CET 2013


Following a recent post describing a mute button misbehaviour with 
skins2, there was indeed a problem in the current git master both at the 
skins2 and the Aout levels.

- at the skins2 level, the "mute" variable was not yet used (a patch has 
just been committed to fix that)
- at the pulse level, there seems to be a missing aout_MuteReport in the 
aout_MuteSet function.
- at the playlist level, there is an additional setting of the "mute" 
variable that seems redundant.

For the last two issues, I attached patches to this mail for review. 
There may be other missing aout_MuteReport in Windows audio drivers, 
since the original mail was describing the problem for Windows and not 
Linux.

Erwan
-------------- next part --------------
>From 567ee1449c20ad22f7c6dffe5f09069186902452 Mon Sep 17 00:00:00 2001
From: Erwan Tulou <erwan10 at videolan.org>
Date: Wed, 20 Mar 2013 01:05:32 +0100
Subject: [PATCH 1/2] pulse: send a MuteReport when successfully setting mute

---
 modules/audio_output/pulse.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 8ca3d4d..06c1bfd 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -648,7 +648,7 @@ static int MuteSet(audio_output_t *aout, bool mute)
         sys->flags_force &= ~(PA_STREAM_START_MUTED|PA_STREAM_START_UNMUTED);
         sys->flags_force |=
             mute ? PA_STREAM_START_MUTED : PA_STREAM_START_UNMUTED;
-        return 0;
+        goto end;
     }
 
     pa_operation *op;
@@ -659,6 +659,8 @@ static int MuteSet(audio_output_t *aout, bool mute)
         pa_operation_unref(op);
     pa_threaded_mainloop_unlock(sys->mainloop);
 
+end:
+    aout_MuteReport(aout,mute);
     return 0;
 }
 
-- 
1.7.9.5


-------------- next part --------------
>From 59afd4c6faa13cbde4bc8f831e66fc8e59496912 Mon Sep 17 00:00:00 2001
From: Erwan Tulou <erwan10 at videolan.org>
Date: Wed, 20 Mar 2013 01:16:11 +0100
Subject: [PATCH 2/2] aout: remove unneeded update of mute

if aout_MuteSet returns successfully, it should have updated the "mute" variables at the aout and playlist levels.
---
 src/playlist/aout.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/src/playlist/aout.c b/src/playlist/aout.c
index 72c7f0f..5a45515 100644
--- a/src/playlist/aout.c
+++ b/src/playlist/aout.c
@@ -120,8 +120,6 @@ int playlist_MuteSet (playlist_t *pl, bool mute)
     {
         ret = aout_MuteSet (aout, mute);
         vlc_object_release (aout);
-        if (ret == 0)
-            var_SetBool (pl, "mute", mute);
     }
     return ret;
 }
-- 
1.7.9.5




More information about the vlc-devel mailing list