---
 libavformat/utils.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 373f068..67f702e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2133,7 +2133,7 @@ static int has_decode_delay_been_guessed(AVStream *st)
 static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary 
**options)
 {
     AVCodec *codec;
-    int got_picture = 1, ret = 0;
+    int got_picture = 1, ret = 0, flushing = !avpkt->size;
     AVFrame picture;
     AVPacket pkt = *avpkt;
 
@@ -2169,6 +2169,8 @@ static int try_decode_frame(AVStream *st, AVPacket 
*avpkt, AVDictionary **option
                 st->info->nb_decoded_frames++;
             pkt.data += ret;
             pkt.size -= ret;
+            if (flushing && !got_picture)
+                ret = -1;
         }
     }
     return ret;
-- 
1.7.8.3

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to