]> git.sesse.net Git - vlc/commitdiff
pulse: Use the 'user-agent' variable for the client name.
authorColin Guthrie <cguthrie@mandriva.org>
Mon, 7 Jun 2010 23:34:43 +0000 (00:34 +0100)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 8 Jun 2010 05:34:30 +0000 (08:34 +0300)
Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
modules/audio_output/pulse.c

index e7c74508dc16be118d82d360378070424fa0481a..0a6b2e0456f8ec9d263e56ecfa2b28d65d4b1cc1 100644 (file)
@@ -63,8 +63,6 @@ struct aout_sys_t
     mtime_t start_date;
 };
 
-#define    PULSE_CLIENT_NAME N_("VLC media player")
-
 #if 0
 #define PULSE_DEBUG( ...) \
     msg_Dbg( p_aout, __VA_ARGS__ )
@@ -121,6 +119,7 @@ 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 = NULL;
 
     if( !vlc_xlib_init( p_this ) )
         return VLC_EGENERIC;
@@ -210,7 +209,12 @@ static int Open ( vlc_object_t *p_this )
         goto fail;
     }
 
-    if (!(p_sys->context = pa_context_new(pa_threaded_mainloop_get_api(p_sys->mainloop), _( PULSE_CLIENT_NAME )))) {
+    if ((p_client_name = var_InheritString(p_aout, "user-agent")) == NULL) {
+        msg_Err(p_aout, "No user-agent string available.");
+        goto fail;
+    }
+
+    if (!(p_sys->context = pa_context_new(pa_threaded_mainloop_get_api(p_sys->mainloop), p_client_name))) {
         msg_Err(p_aout, "Failed to allocate context");
         goto fail;
     }
@@ -303,6 +307,8 @@ unlock_and_fail:
     if (p_sys->mainloop)
         pa_threaded_mainloop_unlock(p_sys->mainloop);
 fail:
+    if (p_client_name)
+        free(p_client_name);
     msg_Dbg(p_aout, "Pulse initialization failed");
     uninit(p_aout);
     return VLC_EGENERIC;