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

module: pass VLC object to vlc_module_unload()

parent c892276f
......@@ -36,7 +36,10 @@ typedef void (*vlc_deactivate_t)(void *func, va_list args);
VLC_API module_t * vlc_module_load( vlc_object_t *obj, const char *cap, const char *name, bool strict, vlc_activate_t probe, ... ) VLC_USED;
#define vlc_module_load(o,c,n,s,...) \
vlc_module_load(VLC_OBJECT(o),c,n,s,__VA_ARGS__)
VLC_API void vlc_module_unload( module_t *, vlc_deactivate_t deinit, ... );
VLC_API void vlc_module_unload( vlc_object_t *obj, module_t *,
vlc_deactivate_t deinit, ... );
#define vlc_module_unload(o,m,d,...) \
vlc_module_unload(VLC_OBJECT(o),m,d,__VA_ARGS__)
VLC_API module_t * module_need( vlc_object_t *, const char *, const char *, bool ) VLC_USED;
#define module_need(a,b,c,d) module_need(VLC_OBJECT(a),b,c,d)
......
......@@ -1108,7 +1108,7 @@ static void Stop(audio_output_t *aout)
assert(sys->stream != NULL);
EnterMTA();
vlc_module_unload(sys->module, aout_stream_Stop, sys->stream);
vlc_module_unload(sys->stream, sys->module, aout_stream_Stop, sys->stream);
LeaveMTA();
vlc_object_release(sys->stream);
......
......@@ -260,7 +260,7 @@ static void Stop(audio_output_t *aout)
assert (sys->stream != NULL);
EnterMTA();
vlc_module_unload(sys->module, aout_stream_Stop, sys->stream);
vlc_module_unload(sys->stream, sys->module, aout_stream_Stop, sys->stream);
LeaveMTA();
vlc_object_release(sys->stream);
......
......@@ -148,6 +148,6 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *avctx,
void vlc_va_Delete(vlc_va_t *va, void *hwctx)
{
vlc_module_unload(va->module, vlc_va_Stop, va, hwctx);
vlc_module_unload(va, va->module, vlc_va_Stop, va, hwctx);
vlc_object_release(va);
}
......@@ -410,7 +410,7 @@ void vlc_LogSet(libvlc_int_t *vlc, vlc_log_cb cb, void *opaque)
vlc_rwlock_unlock(&logger->lock);
if (module != NULL)
vlc_module_unload(module, vlc_logger_unload, sys);
vlc_module_unload(vlc, module, vlc_logger_unload, sys);
/* Announce who we are */
msg_Dbg (vlc, "VLC media player - %s", VERSION_MESSAGE);
......@@ -427,7 +427,7 @@ void vlc_LogDeinit(libvlc_int_t *vlc)
return;
if (logger->module != NULL)
vlc_module_unload(logger->module, vlc_logger_unload, logger->sys);
vlc_module_unload(vlc, logger->module, vlc_logger_unload, logger->sys);
else
/* Flush early log messages (corner case: no call to vlc_LogInit()) */
if (logger->log == vlc_vaLogEarly)
......
......@@ -322,13 +322,14 @@ done:
return module;
}
#undef vlc_module_unload
/**
* Deinstantiates a module.
* \param module the module pointer as returned by vlc_module_load()
* \param deinit deactivation callback
*/
void vlc_module_unload(module_t *module, vlc_deactivate_t deinit, ...)
void vlc_module_unload(vlc_object_t *obj, module_t *module,
vlc_deactivate_t deinit, ...)
{
if (module->pf_deactivate != NULL)
{
......@@ -338,6 +339,7 @@ void vlc_module_unload(module_t *module, vlc_deactivate_t deinit, ...)
deinit(module->pf_deactivate, ap);
va_end(ap);
}
(void) obj;
}
......@@ -368,7 +370,7 @@ module_t *module_need(vlc_object_t *obj, const char *cap, const char *name,
void module_unneed(vlc_object_t *obj, module_t *module)
{
msg_Dbg(obj, "removing module \"%s\"", module_get_object(module));
vlc_module_unload(module, generic_stop, obj);
vlc_module_unload(obj, module, generic_stop, obj);
}
/**
......
......@@ -131,7 +131,7 @@ void vlc_tls_Delete (vlc_tls_creds_t *crd)
if (crd == NULL)
return;
vlc_module_unload (crd->module, tls_unload, crd);
vlc_module_unload(crd, crd->module, tls_unload, crd);
vlc_object_release (crd);
}
......
......@@ -108,7 +108,7 @@ void vout_window_Delete(vout_window_t *window)
vlc_inhibit_Destroy (w->inhibit);
}
vlc_module_unload(w->module, vout_window_stop, window);
vlc_module_unload(window, w->module, vout_window_stop, window);
vlc_object_release(window);
}
......
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