p_new->verbosity = 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:
return libvlc_InternalAddIntf( p_i->p_libvlc_int, name ) ? -1 : 0;
}
+void libvlc_set_exit_handler( libvlc_instance_t *p_i, void (*cb) (void *),
+ void *data )
+{
+ libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
+ libvlc_SetExitHandler( p_libvlc, cb, data );
+}
+
void libvlc_wait( libvlc_instance_t *p_i )
{
libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
libvlc_InternalWait( p_libvlc );
}
+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)
+ && (asprintf (&str, "%s LibVLC/"PACKAGE_VERSION, http) != -1))
+ {
+ var_SetString (p_libvlc, "http-user-agent", str);
+ free (str);
+ }
+}
+
const char * libvlc_get_version(void)
{
return VLC_Version();