diff options
author | RĂ©mi Denis-Courmont <remi@remlab.net> | 2013-07-24 19:50:43 +0300 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-26 11:43:38 +0200 |
commit | 70127070dd9f7eef52ed029dd68606b0c8efd137 (patch) | |
tree | 5b18ec3f2a2b4471f94dd3aa23a4c2006aa82d50 | |
parent | d83ab33715cbf25ed552306a436d39531b07c55b (diff) | |
download | ffmpeg-70127070dd9f7eef52ed029dd68606b0c8efd137.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>
(cherry picked from commit 93a51984a27f3ba84d4e6f13d0c704ee9891603e)
Conflicts:
libavcodec/mpeg12dec.c
-rw-r--r-- | libavcodec/mpeg12.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 40219960da..7f72f13f44 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2277,7 +2277,8 @@ static int decode_chunks(AVCodecContext *avctx, buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &start_code); if (start_code > 0x1ff) { if (s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT) { - if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) { + if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && + !avctx->hwaccel) { int i; av_assert0(avctx->thread_count > 1); @@ -2337,7 +2338,8 @@ static int decode_chunks(AVCodecContext *avctx, s2->intra_dc_precision= 3; s2->intra_matrix[0]= 1; } - 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, @@ -2504,7 +2506,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; |