diff options
author | RĂ©mi Denis-Courmont <remi@remlab.net> | 2013-07-24 19:50:43 +0300 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-07-25 19:43:32 +0200 |
commit | 93a51984a27f3ba84d4e6f13d0c704ee9891603e (patch) | |
tree | 5a4a30433ccc51d73cb5b5c50aa0feebc893f2b5 /libavcodec | |
parent | 582963a8156522582e55466be4a59974a8d909a5 (diff) | |
download | ffmpeg-93a51984a27f3ba84d4e6f13d0c704ee9891603e.tar.gz |
mpeg12: Ignore slice threading if hwaccel is active
Slice threading does not work with hardware acceleration, as decoding
is per-picture. This fixes Bugzilla #542.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpeg12dec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index d7d893b10a..2fcb78005d 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2067,7 +2067,8 @@ static int decode_chunks(AVCodecContext *avctx, buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code); if (start_code > 0x1ff) { if (!skip_frame) { - if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) { + if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && + !avctx->hwaccel) { int i; avctx->execute(avctx, slice_decode_thread, &s2->thread_context[0], NULL, s->slice_count, sizeof(void*)); @@ -2117,7 +2118,8 @@ static int decode_chunks(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && s->slice_count) { + if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && + !avctx->hwaccel && s->slice_count) { int i; avctx->execute(avctx, slice_decode_thread, @@ -2263,7 +2265,8 @@ static int decode_chunks(AVCodecContext *avctx, break; } - if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) { + if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && + !avctx->hwaccel) { int threshold = (s2->mb_height * s->slice_count + s2->slice_context_count / 2) / s2->slice_context_count; |