mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
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>
This commit is contained in:
parent
582963a815
commit
93a51984a2
@ -2067,7 +2067,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||||||
buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code);
|
buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &start_code);
|
||||||
if (start_code > 0x1ff) {
|
if (start_code > 0x1ff) {
|
||||||
if (!skip_frame) {
|
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;
|
int i;
|
||||||
|
|
||||||
avctx->execute(avctx, slice_decode_thread, &s2->thread_context[0], NULL, s->slice_count, sizeof(void*));
|
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;
|
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;
|
int i;
|
||||||
|
|
||||||
avctx->execute(avctx, slice_decode_thread,
|
avctx->execute(avctx, slice_decode_thread,
|
||||||
@ -2263,7 +2265,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||||||
break;
|
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 +
|
int threshold = (s2->mb_height * s->slice_count +
|
||||||
s2->slice_context_count / 2) /
|
s2->slice_context_count / 2) /
|
||||||
s2->slice_context_count;
|
s2->slice_context_count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user