diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2024-06-24 12:47:44 +0800 |
---|---|---|
committer | Nuo Mi <nuomi2021@gmail.com> | 2024-06-27 20:54:42 +0800 |
commit | 6aeb084c395dd3240e203d7b6a053cbdfec2ac99 (patch) | |
tree | 2a75c1c0f0a2990a754080804b5ed8afd1512a54 /libavcodec/vvc/dec.c | |
parent | baf3123c1c849f7fb909d96c8ad0b1ead2bc4128 (diff) | |
download | ffmpeg-6aeb084c395dd3240e203d7b6a053cbdfec2ac99.tar.gz |
avcodec/vvc: Don't create new thread when thread_count is 1
Make its behavior consistent with other decoders, e.g., H.264/H.265.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavcodec/vvc/dec.c')
-rw-r--r-- | libavcodec/vvc/dec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index a8a9a7c99d..a6b601b778 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -1022,7 +1022,7 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx) static AVOnce init_static_once = AV_ONCE_INIT; const int cpu_count = av_cpu_count(); const int delayed = FFMIN(cpu_count, VVC_MAX_DELAYED_FRAMES); - const int thread_count = avctx->thread_count ? avctx->thread_count : delayed; + int thread_count = avctx->thread_count ? avctx->thread_count : delayed; int ret; s->avctx = avctx; @@ -1049,6 +1049,8 @@ static av_cold int vvc_decode_init(AVCodecContext *avctx) return ret; } + if (thread_count == 1) + thread_count = 0; s->executor = ff_vvc_executor_alloc(s, thread_count); if (!s->executor) return AVERROR(ENOMEM); |