aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-11-06 13:02:16 +0100
committerwm4 <nfxjfg@googlemail.com>2015-11-07 19:24:49 +0100
commita55fbfa4c4967068a9c37f041110ace9fb633d4e (patch)
tree7e2d26544d6d043d70341b5826c9ba13e67aeeb3
parentb07cbf6724207ba768ebb2ccdee1b6749fd6ca31 (diff)
downloadffmpeg-a55fbfa4c4967068a9c37f041110ace9fb633d4e.tar.gz
mmaldec: correct package buffering accounting
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. For some reason, this happened especially with VC-1.
-rw-r--r--libavcodec/mmaldec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 8d74b3f0b3..d419096c9a 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);
}