[FFmpeg-cvslog] mmaldec: send only a single EOS packet on flushing
wm4
git at videolan.org
Tue Jun 21 13:22:15 CEST 2016
ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Thu Apr 14 12:21:22 2016 +0200| [ce589940c2cac936891e8bba275580d6efc41e8b] | committer: Anton Khirnov
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.
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce589940c2cac936891e8bba275580d6efc41e8b
---
libavcodec/mmaldec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 77838dc..3cc9691 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -477,6 +477,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