summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-07-10 21:23:09 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2011-07-10 21:41:57 -0700
commitd1cf45911935cc4fed9afd3a37d99616d31eb9da (patch)
tree263ded261a7f185d4c1528c5610208dfd59f007b /libavcodec/pthread.c
parent5eafc8b46644764f8aef1b7b2ecae53ee8034822 (diff)
vp8/mt: flush worker thread, not application thread context, on seek.
This prevents a crash when seeking.
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 77e072d96a..e546c21ddd 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -747,9 +747,12 @@ void ff_thread_flush(AVCodecContext *avctx)
if (!avctx->thread_opaque) return;
park_frame_worker_threads(fctx, avctx->thread_count);
-
- if (fctx->prev_thread)
- update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
+ 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;
fctx->delaying = 1;