]> git.sesse.net Git - ffmpeg/commitdiff
mmaldec: send only a single EOS packet on flushing
authorwm4 <nfxjfg@googlemail.com>
Tue, 10 Nov 2015 12:47:01 +0000 (13:47 +0100)
committerwm4 <nfxjfg@googlemail.com>
Tue, 10 Nov 2015 12:47:37 +0000 (13:47 +0100)
Fixes apparent mmal_port_disable() freezes in ffmmal_stop_decoder() when
calling ffmmal_decode() with flush semantics a large number of times in
a row.

libavcodec/mmaldec.c

index d419096c9a0f0d08c03dc0105a7417fdfcaa2340..281071cc808d3e96052b7bfbcf82970e66a3f77a 100644 (file)
@@ -476,6 +476,8 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt,
         if (!is_extradata)
             ctx->packets_sent++;
     } else {
+        if (ctx->eos_sent)
+            goto done;
         if (!ctx->packets_sent) {
             // Short-cut the flush logic to avoid upsetting MMAL.
             ctx->eos_sent = 1;