summaryrefslogtreecommitdiff
path: root/libavcodec/mmaldec.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-11-10 13:47:01 +0100
committerwm4 <nfxjfg@googlemail.com>2015-11-10 13:47:37 +0100
commitdafe4cd29cada351a2785433b24401fc602911c4 (patch)
tree1921b1f6b705b98d4449c91888507285c2b8f137 /libavcodec/mmaldec.c
parent8a024f6a43444a73a3cd8d70abedde426b4e1986 (diff)
downloadffmpeg-dafe4cd29cada351a2785433b24401fc602911c4.tar.gz
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.
Diffstat (limited to 'libavcodec/mmaldec.c')
-rw-r--r--libavcodec/mmaldec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index d419096c9a..281071cc80 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;