[vlc-devel] [PATCH 21/23] va_surface: release the surfaces held locally in DestroyVideoDecoder()

Steve Lhomme robux4 at videolabs.io
Wed Jun 21 14:15:06 CEST 2017


If upper levels still hold references they will still be usable.
---
 modules/codec/avcodec/va_surface.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index 3c425c2780..fe15966888 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -43,6 +43,8 @@ struct picture_sys_t {
 
 static void DestroyVideoDecoder(vlc_va_t *va, va_pool_t *va_pool)
 {
+    for (unsigned i = 0; i < va_pool->surface_count; i++)
+        va_surface_Release(va_pool->surface[i]->va_surface);
     va_pool->pf_destroy_surfaces(va);
     va_pool->surface_count = 0;
 }
-- 
2.12.1



More information about the vlc-devel mailing list