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

Martin Storsjö git at videolan.org
Tue Apr 10 15:13:39 CEST 2012


vlc | branch: master | Martin Storsjö <martin at martin.st> | Sun Apr  8 23:17:21 2012 +0300| [a7d96e44322e71e54d81c5ec3f029d4bd579ec93] | committer: Jean-Baptiste Kempf

omxil: Dequeue output frames even if there's no picture to write them into

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.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a7d96e44322e71e54d81c5ec3f029d4bd579ec93
---

 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;
         }



More information about the vlc-commits mailing list