[vlc-commits] mmal: add picture destroy callback

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


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

mmal: add picture destroy callback

Since there is something to free.

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

 modules/hw/mmal/vout.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 2a19556b4c..85210be407 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -447,6 +447,11 @@ static int configure_display(vout_display_t *vd, const vout_display_cfg_t *cfg,
     return 0;
 }
 
+static void pic_destroy(picture_t *pic)
+{
+    free(pic->p_sys);
+}
+
 static picture_pool_t *vd_pool(vout_display_t *vd, unsigned count)
 {
     vout_display_sys_t *sys = vd->sys;
@@ -512,6 +517,8 @@ static picture_pool_t *vd_pool(vout_display_t *vd, unsigned count)
     }
 
     memset(&picture_res, 0, sizeof(picture_resource_t));
+    picture_res.pf_destroy = pic_destroy;
+
     sys->pictures = calloc(sys->num_buffers, sizeof(picture_t *));
     for (i = 0; i < sys->num_buffers; ++i) {
         picture_res.p_sys = calloc(1, sizeof(picture_sys_t));



More information about the vlc-commits mailing list