summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-25 23:10:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-03-25 23:10:30 +0200
commit9621646eb316d7595f0f8198efd39f36efa30440 (patch)
tree8cc20303687a958f7a1530e14c65e9eadd54be8f /libavcodec/pthread.c
parent8d7f2db60a9cc2b6fd87a410a69f4deafa3edff9 (diff)
parent62ce9defb81d0b6bd179131d1502858c8778f411 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: x86: dsputil: prettyprint gcc inline asm x86: K&R prettyprinting cosmetics for dsputil_mmx.c x86: conditionally compile H.264 QPEL optimizations dsputil_mmx: Surround QPEL macros by "do { } while (0);" blocks. Ignore generated files below doc/. dpcm: convert to bytestream2. interplayvideo: convert to bytestream2. movenc: Merge if statements h264: fix memleak in error path. pthread: Immediately release all frames in ff_thread_flush() h264: Add check for invalid chroma_format_idc utvideo: port header reading to bytestream2. Conflicts: .gitignore configure libavcodec/h264_ps.c libavcodec/interplayvideo.c libavcodec/pthread.c libavcodec/x86/dsputil_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index e253eb9c36..ccf84efdbe 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -907,9 +907,13 @@ void ff_thread_flush(AVCodecContext *avctx)
fctx->next_decoding = fctx->next_finished = 0;
fctx->delaying = 1;
fctx->prev_thread = NULL;
- // Make sure decode flush calls with size=0 won't return old frames
- for (i = 0; i < avctx->thread_count; i++)
- fctx->threads[i].got_frame = 0;
+ for (i = 0; i < avctx->thread_count; i++) {
+ PerThreadContext *p = &fctx->threads[i];
+ // Make sure decode flush calls with size=0 won't return old frames
+ p->got_frame = 0;
+
+ release_delayed_buffers(p);
+ }
}
static int *allocate_progress(PerThreadContext *p)