[vlc-devel] [PATCH 1/2] omxil: Make sure all the real buffers are freed
Martin Storsjö
martin at martin.st
Thu Apr 12 11:15:54 CEST 2012
If there's a sentinel buffer in the queue, don't count it,
but wait until the right number of buffers have been freed.
---
modules/codec/omxil/omxil.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index b57dc59..9a9f8da 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -614,8 +614,10 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
for(j = 0; j < p_port->i_buffers; j++)
{
OMX_FIFO_GET(&p_port->fifo, p_buffer);
- if (p_buffer == &p_sys->sentinel_buffer)
+ if (p_buffer == &p_sys->sentinel_buffer) {
+ j--;
continue;
+ }
omx_error = OMX_FreeBuffer( omx_handle,
p_port->i_port_index, p_buffer );
@@ -1090,8 +1092,10 @@ static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port)
for(i = 0; i < p_port->i_buffers; i++)
{
OMX_FIFO_GET(&p_port->fifo, p_buffer);
- if (p_buffer == &p_sys->sentinel_buffer)
+ if (p_buffer == &p_sys->sentinel_buffer) {
+ i--;
continue;
+ }
omx_error = OMX_FreeBuffer( p_sys->omx_handle,
p_port->i_port_index, p_buffer );
--
1.7.9
More information about the vlc-devel
mailing list