[vlc-devel] [PATCH 5/6] omxil: Handle sentinel buffers in DecodeAudio, too
Martin Storsjö
martin at martin.st
Mon Dec 19 16:03:03 CET 2011
These buffers were introduced to avoid a potential deadlock
when the codec has issued a PortSettingsChanged event but
not returned any buffers to the client, making the DecodeVideo
function hang waiting for an input buffer to use, before
handling the reconfigure. The same handling needs to be done
for DecodeAudio too, otherwise it will try to use the
sentinel buffer as a normal one.
---
modules/codec/omxil/omxil.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 92f2be7..7be3ec6 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -1372,6 +1372,10 @@ aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
/* Send the input buffer to the component */
OMX_FIFO_GET(&p_sys->in.fifo, p_header);
+
+ if (p_header && p_header->nFlags & OMX_BUFFERFLAG_EOS)
+ goto reconfig;
+
if(p_header)
{
p_header->nFilledLen = p_block->i_buffer;
@@ -1408,6 +1412,7 @@ aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
*pp_block = NULL; /* Avoid being fed the same packet again */
}
+reconfig:
/* Handle the PortSettingsChanged events */
for(i = 0; i < p_sys->ports; i++)
{
--
1.7.2.5
More information about the vlc-devel
mailing list