[vlc-commits] PulseAudio: set the media role on streams (fixes #5101)

Rémi Denis-Courmont git at videolan.org
Wed Aug 8 18:20:44 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug  8 19:17:33 2012 +0300| [5d83714594cbb96aa93dadf55e6a23e10f4da2d1] | committer: Rémi Denis-Courmont

PulseAudio: set the media role on streams (fixes #5101)

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

 modules/audio_output/pulse.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index db5bfbb..4c9351f 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -50,14 +50,6 @@ vlc_module_begin ()
     set_callbacks( Open, Close )
 vlc_module_end ()
 
-/* TODO:
- * - pause input on policy event
- * - resample to compensate for long term drift
- * - select music or video stream property correctly (?)
- * - set further appropriate stream properties
- * - update output devices list dynamically
- */
-
 /* NOTE:
  * Be careful what you do when the PulseAudio mainloop is held, which is to say
  * within PulseAudio callbacks, or after pa_threaded_mainloop_lock().
@@ -888,9 +880,15 @@ static int Open(vlc_object_t *obj)
 
     /* Create a playback stream */
     pa_stream *s;
+    pa_proplist *props = pa_proplist_new();
+    if (likely(props != NULL))
+        /* TODO: set other stream properties */
+        pa_proplist_sets (props, PA_PROP_MEDIA_ROLE, "video");
 
     pa_threaded_mainloop_lock(sys->mainloop);
-    s = pa_stream_new_extended(ctx, "audio stream", formatv, formatc, NULL);
+    s = pa_stream_new_extended(ctx, "audio stream", formatv, formatc, props);
+    if (likely(props != NULL))
+        pa_proplist_free(props);
 
     for (unsigned i = 0; i < formatc; i++)
         pa_format_info_free(formatv[i]);



More information about the vlc-commits mailing list