[vlc-devel] [PATCH] decoder_helpers: release the resources the decoder device may have created

Rémi Denis-Courmont remi at remlab.net
Fri Jun 7 16:28:11 CEST 2019


No objection. Though in hindsight, the resource system was not exactly a great success. Do we have an actual decoder user yet?

Le 7 juin 2019 16:49:15 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>Otherwise it leaks or asserts.
>---
> src/input/decoder_helpers.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
>index 3d1c574cb7..1c4593db30 100644
>--- a/src/input/decoder_helpers.c
>+++ b/src/input/decoder_helpers.c
>@@ -31,6 +31,7 @@
> #include <vlc_atomic.h>
> #include <vlc_meta.h>
> #include <vlc_modules.h>
>+#include "libvlc.h"
> 
>void decoder_Init( decoder_t *p_dec, const es_format_t *restrict p_fmt
>)
> {
>@@ -138,6 +139,7 @@ vlc_decoder_device_Create(vout_window_t *window)
>     free(name);
>     if (!priv->module)
>     {
>+        vlc_objres_clear(VLC_OBJECT(&priv->device));
>         vlc_object_delete(&priv->device);
>         return NULL;
>     }
>@@ -162,6 +164,7 @@ vlc_decoder_device_Release(vlc_decoder_device
>*device)
>     if (vlc_atomic_rc_dec(&priv->rc))
>     {
>         vlc_module_unload(priv->module, decoder_device_Close, device);
>+        vlc_objres_clear(VLC_OBJECT(device));
>         vlc_object_delete(device);
>     }
> }
>-- 
>2.17.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190607/23364f31/attachment.html>


More information about the vlc-devel mailing list