if (vlc == NULL)
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__
libvlc_add_intf (vlc, "globalhotkeys,none");
add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, true )
change_safe()
- add_string( "http-user-agent", PACKAGE_NAME"/"PACKAGE_VERSION, NULL,
+ add_string( "http-user-agent", NULL, NULL,
AGENT_TEXT, AGENT_LONGTEXT, true )
change_safe()
change_need_restart()
const char *name, const char *http)
{
libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
+ char *str;
var_SetString (p_libvlc, "user-agent", name);
- if (http != NULL)
- var_SetString (p_libvlc, "http-user-agent", http);
+ if ((http != NULL)
+ && (asprintf (&str, "%s LibVLC/"PACKAGE_VERSION, http) != -1))
+ {
+ var_SetString (p_libvlc, "http-user-agent", str);
+ free (str);
+ }
}
const char * libvlc_get_version(void)