[vlc-commits] PulseAudio: add a "?" choice if our stream moves to an unknown sink

Rémi Denis-Courmont git at videolan.org
Thu Oct 6 19:09:32 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct  6 20:07:41 2011 +0300| [cec96f5c6c89fa30d4b32b911935b78aab82b5ad] | committer: Rémi Denis-Courmont

PulseAudio: add a "?" choice if our stream moves to an unknown sink

This happens if the stream to a device that appeared after the stream
was started.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cec96f5c6c89fa30d4b32b911935b78aab82b5ad
---

 modules/audio_output/pulse.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 8f48bf2..61fe648 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -392,6 +392,16 @@ static void stream_moved_cb(pa_stream *s, void *userdata)
     /* Update the variable if someone else moved our stream */
     var_Change(aout, "audio-device", VLC_VAR_SETVALUE,
                &(vlc_value_t){ .i_int = idx }, NULL);
+
+    /* Sink unknown as yet, create stub choice for it */
+    if (var_GetInteger(aout, "audio-device") != idx)
+    {
+        var_Change(aout, "audio-device", VLC_VAR_ADDCHOICE,
+                   &(vlc_value_t){ .i_int = idx },
+                   &(vlc_value_t){ .psz_string = (char *)"?" });
+        var_Change(aout, "audio-device", VLC_VAR_SETVALUE,
+                   &(vlc_value_t){ .i_int = idx }, NULL);
+    }
 }
 
 static void stream_overflow_cb(pa_stream *s, void *userdata)



More information about the vlc-commits mailing list