[vlc-commits] vout: use vlc_module_(|un)load for display
Rémi Denis-Courmont
git at videolan.org
Sun Oct 28 11:18:22 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 28 12:14:18 2018 +0200| [b7489b4982a0a90c00b8c58cbc72774eea525b25] | committer: Rémi Denis-Courmont
vout: use vlc_module_(|un)load for display
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b7489b4982a0a90c00b8c58cbc72774eea525b25
---
src/video_output/display.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 1e215bc42c..21b0b3ed87 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -69,6 +69,14 @@ static picture_t *VideoBufferNew(filter_t *filter)
*
*****************************************************************************/
+static int vout_display_start(void *func, va_list ap)
+{
+ int (*activate)(vlc_object_t *) = func;
+ vout_display_t *vd = va_arg(ap, vout_display_t *);
+
+ return activate(VLC_OBJECT(vd));
+}
+
/**
* It creates a new vout_display_t using the given configuration.
*/
@@ -104,7 +112,7 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
vd->owner = *owner;
if (load_module) {
- vd->module = module_need(vd, "vout display", module, module && *module != '\0');
+ vd->module = vlc_module_load(vd, "vout display", module, module && *module != '\0', vout_display_start, vd);
if (!vd->module) {
vlc_object_release(vd);
return NULL;
@@ -119,13 +127,21 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
return vd;
}
+static void vout_display_stop(void *func, va_list ap)
+{
+ void (*deactivate)(vlc_object_t *) = func;
+ vout_display_t *vd = va_arg(ap, vout_display_t *);
+
+ deactivate(VLC_OBJECT(vd));
+}
+
/**
* It deletes a vout_display_t
*/
static void vout_display_Delete(vout_display_t *vd)
{
if (vd->module)
- module_unneed(vd, vd->module);
+ vlc_module_unload(vd, vd->module, vout_display_stop, vd);
video_format_Clean(&vd->source);
video_format_Clean(&vd->fmt);
More information about the vlc-commits
mailing list