Commit 9cca21d4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

lib: fix wrong user-agent and http-user-agent values at start

VLC main() initializes the values too late for interfaces and playlist.
parent 0ad07a9d
......@@ -69,8 +69,6 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
p_new->ref_count = 1;
p_new->p_callback_list = NULL;
vlc_mutex_init(&p_new->instance_lock);
var_Create( p_libvlc_int, "http-user-agent",
VLC_VAR_STRING|VLC_VAR_DOINHERIT );
return p_new;
error:
......
......@@ -385,8 +385,16 @@ dbus_out:
/* some default internal settings */
var_Create( p_libvlc, "window", VLC_VAR_STRING );
/* NOTE: Because the playlist and interfaces start before this function
* returns control to the application (DESIGN BUG!), all these variables
* must be created (in place of libvlc_new()) and set to VLC defaults
* (in place of VLC main()) *here*. */
var_Create( p_libvlc, "user-agent", VLC_VAR_STRING );
var_SetString( p_libvlc, "user-agent", "(LibVLC "VERSION")" );
var_SetString( p_libvlc, "user-agent",
"VLC media player (LibVLC "VERSION")" );
var_Create( p_libvlc, "http-user-agent", VLC_VAR_STRING );
var_SetString( p_libvlc, "http-user-agent",
"VLC/"PACKAGE_VERSION" LibVLC/"PACKAGE_VERSION );
/* System specific configuration */
system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );
......
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