mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
omx: Reset nOffset to 0 in EmptyBufferDone if nFilledLen is 0
Some OMX implementations don't reset nOffset when the complete buffer is emptied but instead only reset nFilledLen. We reset nOffset to 0 if nFilledLen == 0, which is safe to do because the offset *must* be 0 if the buffer is not filled at all. Seen in QCOM's OMX implementation.
This commit is contained in:
parent
ac8085dce9
commit
2750a8869b
1 changed files with 10 additions and 5 deletions
15
omx/gstomx.c
15
omx/gstomx.c
|
@ -333,12 +333,17 @@ EmptyBufferDone (OMX_HANDLETYPE hComponent, OMX_PTR pAppData,
|
|||
port->index, buf);
|
||||
buf->used = FALSE;
|
||||
|
||||
if (comp->hacks & GST_OMX_HACK_NO_NOFFSET_RESET) {
|
||||
if (buf->omx_buf->nFilledLen != 0)
|
||||
GST_WARNING_OBJECT (comp->parent,
|
||||
"Not completely emptied buffer returned");
|
||||
/* Some OMX implementations don't reset nOffset
|
||||
* when the complete buffer is emptied but instead
|
||||
* only reset nFilledLen. We reset nOffset to 0
|
||||
* if nFilledLen == 0, which is safe to do because
|
||||
* the offset *must* be 0 if the buffer is not
|
||||
* filled at all.
|
||||
*
|
||||
* Seen in QCOM's OMX implementation.
|
||||
*/
|
||||
if (buf->omx_buf->nFilledLen == 0)
|
||||
buf->omx_buf->nOffset = 0;
|
||||
}
|
||||
|
||||
g_queue_push_tail (port->pending_buffers, buf);
|
||||
g_cond_broadcast (port->port_cond);
|
||||
|
|
Loading…
Reference in a new issue