[vlc-devel] [PATCH 12/14] mmal/deinterlace: Free unusable buffers
Julian Scheel
julian at jusst.de
Wed Jun 3 09:50:37 CEST 2015
If the input port returns a buffer which has no picture attached to it it
would be leaked. While this in fact should not happen it seems sane to at
least release the buffer and spit a warning in case it does happen.
Signed-off-by: Julian Scheel <julian at jusst.de>
---
modules/hw/mmal/deinterlace.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index 0a56a94..9f06ead 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -432,8 +432,12 @@ static void input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
filter_sys_t *sys = filter->p_sys;
vlc_mutex_lock(&sys->buffer_cond_mutex);
- if (picture)
+ if (picture) {
picture_Release(picture);
+ } else {
+ msg_Warn(filter, "Got buffer without picture on input port - OOOPS");
+ mmal_buffer_header_release(buffer);
+ }
atomic_fetch_sub(&sys->input_in_transit, 1);
vlc_cond_signal(&sys->buffer_cond);
--
2.4.0
More information about the vlc-devel
mailing list