Commit b2cf46dd authored by Julian Scheel's avatar Julian Scheel Committed by Jean-Baptiste Kempf

mmal/deinterlace: Free unusable buffers

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: default avatarJulian Scheel <julian@jusst.de>
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c92f2431
...@@ -432,8 +432,12 @@ static void input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) ...@@ -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; filter_sys_t *sys = filter->p_sys;
vlc_mutex_lock(&sys->buffer_cond_mutex); vlc_mutex_lock(&sys->buffer_cond_mutex);
if (picture) if (picture) {
picture_Release(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); atomic_fetch_sub(&sys->input_in_transit, 1);
vlc_cond_signal(&sys->buffer_cond); vlc_cond_signal(&sys->buffer_cond);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment