[vlc-commits] display: add vlc_objres_clear()
Rémi Denis-Courmont
git at videolan.org
Mon Mar 4 21:05:43 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 4 20:56:44 2019 +0200| [5276e8980472d579c718d89dd655f92bfcb3de1c] | committer: Rémi Denis-Courmont
display: add vlc_objres_clear()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5276e8980472d579c718d89dd655f92bfcb3de1c
---
src/video_output/display.c | 13 +++++++++----
src/video_output/opengl.c | 6 +++++-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index ac5a81092d..f2e6b26260 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -80,8 +80,10 @@ static int vout_display_start(void *func, bool forced, va_list ap)
vd->obj.force = forced; /* TODO: pass to activate() instead? */
int ret = activate(vd, cfg, fmtp, context);
- if (ret != VLC_SUCCESS)
+ if (ret != VLC_SUCCESS) {
video_format_Clean(fmtp);
+ vlc_objres_clear(VLC_OBJECT(vd));
+ }
return ret;
}
@@ -794,9 +796,10 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
#endif
if (VoutDisplayCreateRender(vd)) {
- if (vd->module != NULL)
+ if (vd->module != NULL) {
vlc_module_unload(vd, vd->module, vout_display_stop, vd);
-
+ vlc_objres_clear(VLC_OBJECT(vd));
+ }
video_format_Clean(&vd->fmt);
goto error;
}
@@ -819,8 +822,10 @@ void vout_display_Delete(vout_display_t *vd)
if (osys->pool != NULL)
picture_pool_Release(osys->pool);
- if (vd->module != NULL)
+ if (vd->module != NULL) {
vlc_module_unload(vd, vd->module, vout_display_stop, vd);
+ vlc_objres_clear(VLC_OBJECT(vd));
+ }
if (osys->video_context.device)
vlc_decoder_device_Release(osys->video_context.device);
diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c
index e4bf375b8f..5207e2500a 100644
--- a/src/video_output/opengl.c
+++ b/src/video_output/opengl.c
@@ -45,8 +45,11 @@ static int vlc_gl_start(void *func, bool forced, va_list ap)
unsigned width = va_arg(ap, unsigned);
unsigned height = va_arg(ap, unsigned);
+ int ret = activate(gl, width, height);
+ if (ret)
+ vlc_objres_clear(VLC_OBJECT(gl));
(void) forced;
- return activate(gl, width, height);
+ return ret;
}
static void vlc_gl_stop(void *func, va_list ap)
@@ -110,6 +113,7 @@ void vlc_gl_Release(vlc_gl_t *gl)
return;
vlc_module_unload(gl, gl->module, vlc_gl_stop, gl);
+ vlc_objres_clear(VLC_OBJECT(gl));
vlc_object_release(gl);
}
More information about the vlc-commits
mailing list