[FFmpeg-devel] [PATCH 2/2] mmaldec: correct package buffering accounting
wm4
nfxjfg at googlemail.com
Fri Nov 6 16:15:30 CET 2015
The assert in ffmmal_stop_decoder() could trigger sometimes. The
packets_buffered counter was indeed not correctly maintained, and
packets were not subtracted from it if they were still in the waiting
queue.
---
libavcodec/mmaldec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 8d74b3f..d419096 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -160,6 +160,9 @@ static void ffmmal_stop_decoder(AVCodecContext *avctx)
ctx->waiting_buffers = buffer->next;
+ if (buffer->flags & MMAL_BUFFER_HEADER_FLAG_FRAME_END)
+ avpriv_atomic_int_add_and_fetch(&ctx->packets_buffered, -1);
+
av_buffer_unref(&buffer->ref);
av_free(buffer);
}
--
2.6.1
More information about the ffmpeg-devel
mailing list