From 05fa79b8448059913dea321fdf92764b64deeecc Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 13 Mar 2013 23:36:51 +0100 Subject: hwaccel: fix use with frame based multithreading Allows use of AVHWAccel based decoders with frame based multithreading. The decoders will be forced into an non-concurrent mode by delaying ff_thread_finish_setup() calls after decoding of the current frame is finished. This wastes memory by unnecessarily using multiple threads and thus copies of the decoder context but allows seamless switching between hardware accelerated and frame threaded software decoding when the hardware decoder does not support the stream. --- libavcodec/pthread.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/pthread.c') diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 9a92288dbb..404804dec1 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -428,6 +428,9 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, dst->colorspace = src->colorspace; dst->color_range = src->color_range; dst->chroma_sample_location = src->chroma_sample_location; + + dst->hwaccel = src->hwaccel; + dst->hwaccel_context = src->hwaccel_context; } if (for_user) { -- cgit v1.2.3