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

Revert "dialog: change dialog_provider init/deinit functions"

This reverts commit f36f4152.
parent 0ad258c3
......@@ -28,12 +28,12 @@ typedef struct vlc_dialog_id vlc_dialog_id;
typedef struct extension_dialog_t extension_dialog_t;
/* Called from src/libvlc.c */
int
libvlc_dialog_provider_init(libvlc_int_t *p_libvlc);
vlc_dialog_provider *
vlc_dialog_provider_new(void);
/* Called from src/libvlc.c */
void
libvlc_dialog_provider_deinit(libvlc_int_t *p_libvlc);
vlc_dialog_provider_release(vlc_dialog_provider *p_provider);
/**
* @defgroup vlc_dialog VLC dialog
......
......@@ -145,13 +145,12 @@ dialog_id_release(vlc_dialog_id *p_id)
free(p_id);
}
int
libvlc_dialog_provider_init(libvlc_int_t *p_libvlc)
vlc_dialog_provider *
vlc_dialog_provider_new(void)
{
assert(p_libvlc != NULL);
vlc_dialog_provider *p_provider = malloc(sizeof(*p_provider));
if (p_provider == NULL)
return VLC_EGENERIC;
if( p_provider == NULL )
return NULL;
vlc_mutex_init(&p_provider->lock);
vlc_array_init(&p_provider->dialog_array);
......@@ -161,9 +160,8 @@ libvlc_dialog_provider_init(libvlc_int_t *p_libvlc)
p_provider->pf_ext_update = NULL;
p_provider->p_ext_data = NULL;
libvlc_priv(p_libvlc)->p_dialog_provider = p_provider;
return VLC_SUCCESS;
return p_provider;
}
static int
......@@ -241,10 +239,9 @@ dialog_clear_all_locked(vlc_dialog_provider *p_provider)
}
void
libvlc_dialog_provider_deinit(libvlc_int_t *p_libvlc)
vlc_dialog_provider_release(vlc_dialog_provider *p_provider)
{
assert(p_libvlc != NULL);
vlc_dialog_provider *p_provider = libvlc_priv(p_libvlc)->p_dialog_provider;
assert(p_provider != NULL);
vlc_mutex_lock(&p_provider->lock);
dialog_clear_all_locked(p_provider);
......@@ -252,7 +249,6 @@ libvlc_dialog_provider_deinit(libvlc_int_t *p_libvlc)
vlc_mutex_destroy(&p_provider->lock);
free(p_provider);
libvlc_priv(p_libvlc)->p_dialog_provider = NULL;
}
#undef vlc_dialog_provider_set_callbacks
......
......@@ -235,7 +235,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
}
#endif
if( libvlc_dialog_provider_init( p_libvlc ) != VLC_SUCCESS )
priv->p_dialog_provider = vlc_dialog_provider_new();
if( priv->p_dialog_provider == NULL )
{
vlc_LogDeinit (p_libvlc);
module_EndBank (true);
......@@ -510,7 +511,7 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
libvlc_Quit( p_libvlc );
intf_DestroyAll( p_libvlc );
libvlc_dialog_provider_deinit( p_libvlc );
vlc_dialog_provider_release( priv->p_dialog_provider );
#ifdef ENABLE_VLM
/* Destroy VLM if created in libvlc_InternalInit */
......
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