Skip to content

Commit

Permalink
mmaldec: send only a single EOS packet on flushing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wm4 authored and elenril committed Apr 30, 2016
1 parent 46aaad7 commit ce58994
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavcodec/mmaldec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce58994

Please sign in to comment.