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>
This commit is contained in:
wm4 2016-04-14 12:21:22 +02:00 committed by Anton Khirnov
parent 46aaad78c3
commit ce589940c2
1 changed files with 2 additions and 0 deletions

View File

@ -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;