summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2016-04-14 12:21:22 +0200
committerAnton Khirnov <anton@khirnov.net>2016-04-30 08:26:22 +0200
commitce589940c2cac936891e8bba275580d6efc41e8b (patch)
tree85b3e9c1600f05467894922e7bc3b531167aefa5 /libavcodec
parent46aaad78c3cf03d43e7c9ca1d4a8b8a71fb0527d (diff)
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@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mmaldec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 77838dc509..3cc96912b0 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;