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

Steve Lhomme robux4 at videolabs.io
Tue Jun 20 17:45:47 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 f4beec4e89..205a250d9e 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -47,6 +47,8 @@ struct picture_sys_t {
 
 static void DestroyVideoDecoder(vlc_va_t *va, va_pool_t *va_pool)
 {
+    for (int 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