Commit a55fbfa4 authored by wm4's avatar wm4

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.
parent b07cbf67
...@@ -160,6 +160,9 @@ static void ffmmal_stop_decoder(AVCodecContext *avctx) ...@@ -160,6 +160,9 @@ static void ffmmal_stop_decoder(AVCodecContext *avctx)
ctx->waiting_buffers = buffer->next; 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_buffer_unref(&buffer->ref);
av_free(buffer); av_free(buffer);
} }
......
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