[FFmpeg-cvslog] mmaldec: send only a single EOS packet on flushing
wm4
git at videolan.org
Tue Nov 10 13:47:27 CET 2015
ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Tue Nov 10 13:47:01 2015 +0100| [dafe4cd29cada351a2785433b24401fc602911c4] | committer: wm4
mmaldec: send only a single EOS packet on flushing
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dafe4cd29cada351a2785433b24401fc602911c4
---
libavcodec/mmaldec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index d419096..281071c 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list