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.
---
 libavcodec/mmaldec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index f5b986f..14688d2 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;
-- 
2.8.0.rc3

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to