Commit ad6d069c authored by Colin Guthrie's avatar Colin Guthrie Committed by Jean-Baptiste Kempf

pulse: Use the 'user-agent' variable for the client name.

Signed-off-by: default avatarIlkka Ollakka <ileoo@videolan.org>
(cherry picked from commit 6b710a60659752ef22f404bad116bd2d7c78ce1c)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 82b6b631
...@@ -63,8 +63,6 @@ struct aout_sys_t ...@@ -63,8 +63,6 @@ struct aout_sys_t
mtime_t start_date; mtime_t start_date;
}; };
#define PULSE_CLIENT_NAME N_("VLC media player")
#if 0 #if 0
#define PULSE_DEBUG( ...) \ #define PULSE_DEBUG( ...) \
msg_Dbg( p_aout, __VA_ARGS__ ) msg_Dbg( p_aout, __VA_ARGS__ )
...@@ -121,6 +119,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -121,6 +119,7 @@ static int Open ( vlc_object_t *p_this )
const struct pa_buffer_attr *buffer_attr; const struct pa_buffer_attr *buffer_attr;
struct pa_buffer_attr a; struct pa_buffer_attr a;
struct pa_channel_map map; struct pa_channel_map map;
char * p_client_name = NULL;
if( !vlc_xlib_init( p_this ) ) if( !vlc_xlib_init( p_this ) )
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -210,7 +209,12 @@ static int Open ( vlc_object_t *p_this ) ...@@ -210,7 +209,12 @@ static int Open ( vlc_object_t *p_this )
goto fail; 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"); msg_Err(p_aout, "Failed to allocate context");
goto fail; goto fail;
} }
...@@ -303,6 +307,8 @@ unlock_and_fail: ...@@ -303,6 +307,8 @@ unlock_and_fail:
if (p_sys->mainloop) if (p_sys->mainloop)
pa_threaded_mainloop_unlock(p_sys->mainloop); pa_threaded_mainloop_unlock(p_sys->mainloop);
fail: fail:
if (p_client_name)
free(p_client_name);
msg_Dbg(p_aout, "Pulse initialization failed"); msg_Dbg(p_aout, "Pulse initialization failed");
uninit(p_aout); uninit(p_aout);
return VLC_EGENERIC; return VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment