Commit dafe4cd2 authored by wm4's avatar wm4

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.
parent 8a024f6a
...@@ -476,6 +476,8 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -476,6 +476,8 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt,
if (!is_extradata) if (!is_extradata)
ctx->packets_sent++; ctx->packets_sent++;
} else { } else {
if (ctx->eos_sent)
goto done;
if (!ctx->packets_sent) { if (!ctx->packets_sent) {
// Short-cut the flush logic to avoid upsetting MMAL. // Short-cut the flush logic to avoid upsetting MMAL.
ctx->eos_sent = 1; ctx->eos_sent = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment