Commit d1cf4591 authored by Ronald S. Bultje's avatar Ronald S. Bultje

vp8/mt: flush worker thread, not application thread context, on seek.

This prevents a crash when seeking.
parent 5eafc8b4
...@@ -747,9 +747,12 @@ void ff_thread_flush(AVCodecContext *avctx) ...@@ -747,9 +747,12 @@ void ff_thread_flush(AVCodecContext *avctx)
if (!avctx->thread_opaque) return; if (!avctx->thread_opaque) return;
park_frame_worker_threads(fctx, avctx->thread_count); park_frame_worker_threads(fctx, avctx->thread_count);
if (fctx->prev_thread) {
if (fctx->prev_thread) if (fctx->prev_thread != &fctx->threads[0])
update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 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->next_decoding = fctx->next_finished = 0;
fctx->delaying = 1; fctx->delaying = 1;
......
...@@ -1080,7 +1080,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx) ...@@ -1080,7 +1080,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
{ {
if(HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME) if(HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME)
ff_thread_flush(avctx); ff_thread_flush(avctx);
if(avctx->codec->flush) else if(avctx->codec->flush)
avctx->codec->flush(avctx); avctx->codec->flush(avctx);
} }
......
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