[vlc-commits] mmal/deinterlace: Clear data from buffer header before release
Julian Scheel
git at videolan.org
Fri Jun 5 15:37:15 CEST 2015
vlc | branch: master | Julian Scheel <julian at jusst.de> | Wed Jun 3 09:50:30 2015 +0200| [8bd0fc0425dee28d10b745b8097e8161b34340b6] | committer: Jean-Baptiste Kempf
mmal/deinterlace: Clear data from buffer header before release
The data attached to the output port headers is not owned by the deinterlace
filter but by the vout and only temporarily attached to the codecs buffers. To
avoid refcount issues within the mmal core clear the data field before
releasing the buffers.
Signed-off-by: Julian Scheel <julian at jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8bd0fc0425dee28d10b745b8097e8161b34340b6
---
modules/hw/mmal/deinterlace.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index 2ba63cd..c8b6484 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -522,8 +522,10 @@ static void input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
filter_t *filter = (filter_t *)port->userdata;
filter_sys_t *sys = filter->p_sys;
- buffer->user_data = NULL;
vlc_mutex_lock(&sys->buffer_cond_mutex);
+ buffer->user_data = NULL;
+ buffer->alloc_size = 0;
+ buffer->data = NULL;
mmal_buffer_header_release(buffer);
if (picture)
picture_Release(picture);
@@ -547,6 +549,10 @@ static void output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
picture = (picture_t *)buffer->user_data;
picture_Release(picture);
buffer->user_data = NULL;
+ buffer->alloc_size = 0;
+ buffer->data = NULL;
+ mmal_buffer_header_reset(buffer);
+ mmal_buffer_header_release(buffer);
}
atomic_fetch_sub(&sys->output_in_transit, 1);
More information about the vlc-commits
mailing list