Commit 8460c8d7 authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf

omxil: Make sure all the real buffers are freed

If there's a sentinel buffer in the queue, don't count it,
but wait until the right number of buffers have been freed.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9fb0aecc
...@@ -614,8 +614,10 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec, ...@@ -614,8 +614,10 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
for(j = 0; j < p_port->i_buffers; j++) for(j = 0; j < p_port->i_buffers; j++)
{ {
OMX_FIFO_GET(&p_port->fifo, p_buffer); OMX_FIFO_GET(&p_port->fifo, p_buffer);
if (p_buffer == &p_sys->sentinel_buffer) if (p_buffer == &p_sys->sentinel_buffer) {
j--;
continue; continue;
}
omx_error = OMX_FreeBuffer( omx_handle, omx_error = OMX_FreeBuffer( omx_handle,
p_port->i_port_index, p_buffer ); p_port->i_port_index, p_buffer );
...@@ -1090,8 +1092,10 @@ static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port) ...@@ -1090,8 +1092,10 @@ static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port)
for(i = 0; i < p_port->i_buffers; i++) for(i = 0; i < p_port->i_buffers; i++)
{ {
OMX_FIFO_GET(&p_port->fifo, p_buffer); OMX_FIFO_GET(&p_port->fifo, p_buffer);
if (p_buffer == &p_sys->sentinel_buffer) if (p_buffer == &p_sys->sentinel_buffer) {
i--;
continue; continue;
}
omx_error = OMX_FreeBuffer( p_sys->omx_handle, omx_error = OMX_FreeBuffer( p_sys->omx_handle,
p_port->i_port_index, p_buffer ); p_port->i_port_index, p_buffer );
......
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