You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
avcodec/dnxhdenc: call slice thread code only if slice threading is enabled
This commit is contained in:
@ -526,10 +526,12 @@ FF_DISABLE_DEPRECATION_WARNINGS
|
|||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (avctx->active_thread_type == FF_THREAD_SLICE) {
|
||||||
if (avctx->thread_count > MAX_THREADS) {
|
if (avctx->thread_count > MAX_THREADS) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "too many threads\n");
|
av_log(avctx, AV_LOG_ERROR, "too many threads\n");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (avctx->qmax <= 1) {
|
if (avctx->qmax <= 1) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "qmax must be at least 2\n");
|
av_log(avctx, AV_LOG_ERROR, "qmax must be at least 2\n");
|
||||||
@ -537,10 +539,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx->thread[0] = ctx;
|
ctx->thread[0] = ctx;
|
||||||
|
if (avctx->active_thread_type == FF_THREAD_SLICE) {
|
||||||
for (i = 1; i < avctx->thread_count; i++) {
|
for (i = 1; i < avctx->thread_count; i++) {
|
||||||
ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
|
ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));
|
||||||
memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
|
memcpy(ctx->thread[i], ctx, sizeof(DNXHDEncContext));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail: // for FF_ALLOCZ_OR_GOTO
|
fail: // for FF_ALLOCZ_OR_GOTO
|
||||||
|
Reference in New Issue
Block a user