diff options
author | Janne Grunau <janne-libav@jannau.net> | 2013-03-14 02:36:51 +0400 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2013-03-26 22:44:50 +0400 |
commit | 05fa79b8448059913dea321fdf92764b64deeecc (patch) | |
tree | 59d7af37b80925df399b5ac8d39b61962d3ea50d /libavcodec/h263dec.c | |
parent | c24469e812501903a46a06eff9722a82e136e841 (diff) |
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.
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 28fb2dbbd5..e8edad7ab6 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -627,7 +627,8 @@ retry: if(ff_MPV_frame_start(s, avctx) < 0) return -1; - if (!s->divx_packed) ff_thread_finish_setup(avctx); + if (!s->divx_packed && !avctx->hwaccel) + ff_thread_finish_setup(avctx); if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); @@ -720,6 +721,9 @@ intrax8_decoded: ff_MPV_frame_end(s); + if (!s->divx_packed && avctx->hwaccel) + ff_thread_finish_setup(avctx); + assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type); assert(s->current_picture.f.pict_type == s->pict_type); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { |