[vlc-devel] [PATCH] pulseaudio : get the application name instead of LibVLC in pulseaudio

Matthieu Bedouet mbedouet at gmail.com
Wed Mar 30 23:49:58 CEST 2011


Hi,

Here is a simple fix for an annoying problem.
Currently the applications using libVLC, like the Phonon-vlc backend
are all identified as "LibVLC <version>: audio stream" in pulseaudio,
so they all are the same in the mixers for example.

Just by passing NULL as the application name, Pulseaudio find out
which program is the client.
Other applications are also using the pulseaudio API like this.

p_client_name is not used anymore so I cleaned the references in the file.

Bye,
-- 
Matthieu





diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 710bab2..98b9d25 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -114,7 +114,6 @@ static int Open ( vlc_object_t *p_this )
     const struct pa_buffer_attr *buffer_attr;
     struct pa_buffer_attr a;
     struct pa_channel_map map;
-    char * p_client_name;

     /* Allocate structures */
     p_aout->output.p_sys = p_sys = calloc( 1, sizeof( aout_sys_t ) );
@@ -199,13 +198,7 @@ static int Open ( vlc_object_t *p_this )
         goto fail;
     }

-    if ((p_client_name = var_InheritString(p_aout, "user-agent")) == NULL) {
-        msg_Err(p_aout, "No user-agent string available.");
-        goto fail;
-    }
-
-    p_sys->context =
pa_context_new(pa_threaded_mainloop_get_api(p_sys->mainloop),
p_client_name);
-    free(p_client_name);
+    p_sys->context =
pa_context_new(pa_threaded_mainloop_get_api(p_sys->mainloop), NULL);
     if(!p_sys->context)
     {
         msg_Err(p_aout, "Failed to allocate context");



More information about the vlc-devel mailing list