mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
omx: Reset buffer flags to 0 after it was consumed by the component or the element
Some implementations don't reset the flags and the standard is not really clear on the expected behaviour. Let's just always reset the flags as they're not valid at this point anymore.
This commit is contained in:
parent
ef67a43702
commit
fa6881c1cc
1 changed files with 21 additions and 0 deletions
21
omx/gstomx.c
21
omx/gstomx.c
|
@ -345,6 +345,12 @@ EmptyBufferDone (OMX_HANDLETYPE hComponent, OMX_PTR pAppData,
|
|||
if (buf->omx_buf->nFilledLen == 0)
|
||||
buf->omx_buf->nOffset = 0;
|
||||
|
||||
/* Reset all flags, some implementations don't
|
||||
* reset them themselves and the flags are not
|
||||
* valid anymore after the buffer was consumed
|
||||
*/
|
||||
buf->omx_buf->nFlags = 0;
|
||||
|
||||
g_queue_push_tail (port->pending_buffers, buf);
|
||||
g_cond_broadcast (port->port_cond);
|
||||
g_mutex_unlock (port->port_lock);
|
||||
|
@ -1059,6 +1065,11 @@ gst_omx_port_release_buffer (GstOMXPort * port, GstOMXBuffer * buf)
|
|||
if (port->port_def.eDir == OMX_DirInput) {
|
||||
err = OMX_EmptyThisBuffer (comp->handle, buf->omx_buf);
|
||||
} else {
|
||||
/* Reset all flags, some implementations don't
|
||||
* reset them themselves and the flags are not
|
||||
* valid anymore after the buffer was consumed
|
||||
*/
|
||||
buf->omx_buf->nFlags = 0;
|
||||
err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
|
||||
}
|
||||
|
||||
|
@ -1192,6 +1203,11 @@ gst_omx_port_set_flushing (GstOMXPort * port, gboolean flush)
|
|||
while ((buf = g_queue_pop_head (port->pending_buffers))) {
|
||||
g_assert (!buf->used);
|
||||
|
||||
/* Reset all flags, some implementations don't
|
||||
* reset them themselves and the flags are not
|
||||
* valid anymore after the buffer was consumed
|
||||
*/
|
||||
buf->omx_buf->nFlags = 0;
|
||||
err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
|
||||
if (err != OMX_ErrorNone) {
|
||||
GST_ERROR_OBJECT (comp->parent,
|
||||
|
@ -1578,6 +1594,11 @@ gst_omx_port_set_enabled_unlocked (GstOMXPort * port, gboolean enabled)
|
|||
while ((buf = g_queue_pop_head (port->pending_buffers))) {
|
||||
g_assert (!buf->used);
|
||||
|
||||
/* Reset all flags, some implementations don't
|
||||
* reset them themselves and the flags are not
|
||||
* valid anymore after the buffer was consumed
|
||||
*/
|
||||
buf->omx_buf->nFlags = 0;
|
||||
err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
|
||||
if (err != OMX_ErrorNone) {
|
||||
GST_ERROR_OBJECT (comp->parent,
|
||||
|
|
Loading…
Reference in a new issue