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

Restore LibVLC/VERSION at the end of the HTTP user agent

parent e29d2836
...@@ -203,7 +203,7 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -203,7 +203,7 @@ int main( int i_argc, const char *ppsz_argv[] )
if (vlc == NULL) if (vlc == NULL)
goto out; goto out;
libvlc_set_user_agent (vlc, "VLC media player", NULL); libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
#if !defined (HAVE_MAEMO) && !defined __APPLE__ #if !defined (HAVE_MAEMO) && !defined __APPLE__
libvlc_add_intf (vlc, "globalhotkeys,none"); libvlc_add_intf (vlc, "globalhotkeys,none");
......
...@@ -123,7 +123,7 @@ vlc_module_begin () ...@@ -123,7 +123,7 @@ vlc_module_begin ()
add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL, add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, true ) CACHING_TEXT, CACHING_LONGTEXT, true )
change_safe() change_safe()
add_string( "http-user-agent", PACKAGE_NAME"/"PACKAGE_VERSION, NULL, add_string( "http-user-agent", NULL, NULL,
AGENT_TEXT, AGENT_LONGTEXT, true ) AGENT_TEXT, AGENT_LONGTEXT, true )
change_safe() change_safe()
change_need_restart() change_need_restart()
......
...@@ -133,10 +133,15 @@ void libvlc_set_user_agent (libvlc_instance_t *p_i, ...@@ -133,10 +133,15 @@ void libvlc_set_user_agent (libvlc_instance_t *p_i,
const char *name, const char *http) const char *name, const char *http)
{ {
libvlc_int_t *p_libvlc = p_i->p_libvlc_int; libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
char *str;
var_SetString (p_libvlc, "user-agent", name); var_SetString (p_libvlc, "user-agent", name);
if (http != NULL) if ((http != NULL)
var_SetString (p_libvlc, "http-user-agent", http); && (asprintf (&str, "%s LibVLC/"PACKAGE_VERSION, http) != -1))
{
var_SetString (p_libvlc, "http-user-agent", str);
free (str);
}
} }
const char * libvlc_get_version(void) const char * libvlc_get_version(void)
......
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