[vlc-devel] [PATCH] omxil: Dequeue output frames even if there's no picture to write them into

Martin Storsjö martin at martin.st
Sun Apr 8 22:17:21 CEST 2012


Make sure we always remove all output frames from the output
frame queue, even if there's no picture.

This fixes (for most practical cases at least) the issue where
the app could hang repeating "can't get output picture" after
stopping playback with omxil video decoding.

In that case, the vout didn't return any picture to write the
decoded frames into, causing the omxil codec to run out of output
buffers, blocking, and thus running out of input buffers, blocking
the decoder thread while waiting for a free input buffer.
---
I'd still appreciate some more testing of this, to make sure it
actually fixes the issue.

 modules/codec/omxil/omxil.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 29d92ed..b57dc59 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -1230,12 +1230,13 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
                 /* We're not in direct rendering mode.
                  * Get a new picture and copy the content */
                 p_pic = decoder_NewPicture( p_dec );
-                if( !p_pic ) break; /* No picture available */
 
-                CopyOmxPicture(p_dec, p_pic, p_header, p_sys->out.definition.format.video.nSliceHeight);
+                if (p_pic)
+                    CopyOmxPicture(p_dec, p_pic, p_header, p_sys->out.definition.format.video.nSliceHeight);
             }
 
-            p_pic->date = p_header->nTimeStamp;
+            if (p_pic)
+                p_pic->date = p_header->nTimeStamp;
             p_header->nFilledLen = 0;
             p_header->pAppPrivate = 0;
         }
-- 
1.7.9




More information about the vlc-devel mailing list