omx: Properly release buffers during flushing

We can't pass them back to OMX_FillThisBuffer() or OMX_EmptyThisBuffer()
but instead of doing nothing we have to put them back into our queue.
Otherwise the buffer is leaked and we will have too few buffers in
the future.
This commit is contained in:
Jonas Larsson 2011-11-08 08:22:08 +01:00 committed by Sebastian Dröge
parent 9151617d39
commit 0682012181

View file

@ -1054,6 +1054,8 @@ gst_omx_port_release_buffer (GstOMXPort * port, GstOMXBuffer * buf)
if (port->flushing) {
GST_DEBUG_OBJECT (comp->parent, "Port %u is flushing, not releasing buffer",
port->index);
g_queue_push_tail (port->pending_buffers, buf);
g_cond_broadcast (port->port_cond);
goto done;
}
@ -1073,9 +1075,10 @@ gst_omx_port_release_buffer (GstOMXPort * port, GstOMXBuffer * buf)
err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
}
done:
GST_DEBUG_OBJECT (comp->parent, "Released buffer %p to port %u: %s (0x%08x)",
buf, port->index, gst_omx_error_to_string (err), err);
done:
g_mutex_unlock (port->port_lock);
return err;