[vlc-commits] kva: add picture destroy callback

Rémi Denis-Courmont git at videolan.org
Wed Dec 12 19:44:03 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 12 20:34:32 2018 +0200| [b6343d06c2dc35b6a505980bfbc5099556e33b67] | committer: Rémi Denis-Courmont

kva: add picture destroy callback

Since there is something to free.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b6343d06c2dc35b6a505980bfbc5099556e33b67
---

 modules/video_output/kva.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 59cde2eb43..e13f91beb8 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -490,6 +490,11 @@ static int Control( vout_display_t *vd, int query, va_list args )
 
 /* following functions are local */
 
+static void DestroyPicture( picture_t *pic )
+{
+    free( pic->p_sys );
+}
+
 /*****************************************************************************
  * OpenDisplay: open and initialize KVA device
  *****************************************************************************
@@ -612,7 +617,9 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
         return VLC_ENOMEM;
     picsys->i_chroma_shift = i_chroma_shift;
 
-    picture_resource_t resource = { .p_sys = picsys };
+    picture_resource_t resource = {
+        .p_sys = picsys, .pf_destroy = DestroyPicture,
+    };
     picture_t *picture = picture_NewFromResource( fmt, &resource );
     if( !picture )
     {



More information about the vlc-commits mailing list