]> git.sesse.net Git - vlc/blobdiff - src/control/core.c
Restore LibVLC/VERSION at the end of the HTTP user agent
[vlc] / src / control / core.c
index 942212db77b72e65b65046bfdef25d03d74c95da..1411e9c0824bcb8c43b32cf679467719a5974004 100644 (file)
@@ -133,10 +133,15 @@ void libvlc_set_user_agent (libvlc_instance_t *p_i,
                             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)