[vlc-devel] [RFC 1/2] vdpau: remove hardware context free

Steve Lhomme robux4 at ycbcr.xyz
Thu Dec 20 10:29:20 CET 2018


Looking at the code it doesn't seem like we allocate it, nor lavc. I think in
real life it's always NULL.

There's also nothing in the VDPAU lavc doc that says we have to free it.
---
 modules/hw/vdpau/avcodec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index e4544e6e0c..40b1d8ab23 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -209,10 +209,11 @@ static void Close(vlc_va_t *va, void **hwctx)
 {
     vlc_va_sys_t *sys = va->sys;
 
+    assert(hwctx == NULL);
+
     for (unsigned i = 0; sys->pool[i] != NULL; i++)
         vlc_vdp_video_destroy(sys->pool[i]);
     vdp_release_x11(sys->vdp);
-    av_freep(hwctx);
     free(sys);
 }
 
-- 
2.17.1



More information about the vlc-devel mailing list