summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <[email protected]>2014-02-27 21:36:33 +0100
committerCarl Eugen Hoyos <[email protected]>2014-03-04 01:39:11 +0100
commit2256b2a3c1a6eae15dbfca0b95a64d911d618f40 (patch)
tree9d339c475cf410f7388a6e6f88e58febc7753280
parent89c917fcd92c5e5ae7f226ceb7b1e6a12c82cba7 (diff)
pthread_frame: flush all threads on flush, not just the first one
avcodec_flush_buffers() must release all internally held references according to its documentation, for which all the threads need to be flushed. Bug-Id: vlc/9665 (cherry picked from commit d1f9563d502037239185c11578cc614bdf0c5870) Conflicts: libavcodec/pthread_frame.c
-rw-r--r--libavcodec/pthread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 1ca72b44f2..7a57c2e186 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -912,8 +912,6 @@ void ff_thread_flush(AVCodecContext *avctx)
if (fctx->prev_thread) {
if (fctx->prev_thread != &fctx->threads[0])
update_context_from_thread(fctx->threads[0].avctx, fctx->prev_thread->avctx, 0);
- if (avctx->codec->flush)
- avctx->codec->flush(fctx->threads[0].avctx);
}
fctx->next_decoding = fctx->next_finished = 0;
@@ -925,6 +923,9 @@ void ff_thread_flush(AVCodecContext *avctx)
p->got_frame = 0;
release_delayed_buffers(p);
+
+ if (avctx->codec->flush)
+ avctx->codec->flush(fctx->threads[0].avctx);
}
}