diff options
Diffstat (limited to 'src/codec/ffmpeg')
| -rw-r--r-- | src/codec/ffmpeg/decoder.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c index e22f184..cae56d1 100644 --- a/src/codec/ffmpeg/decoder.c +++ b/src/codec/ffmpeg/decoder.c @@ -256,12 +256,14 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend s32 cpus = 0; if (av->codec_context->codec_type == AVMEDIA_TYPE_VIDEO) { cpus = av_cpu_count(); - cpus = MIN(3, MAX(1, cpus / 2)); + cpus = MIN(4, MAX(1, cpus / 2)); } if (cpus > 0) { av->codec_context->thread_count = cpus; // FF_THREAD_FRAME or FF_THREAD_SLICE. - av->codec_context->thread_type = FF_THREAD_FRAME; + // SLICE seems to work better based on videos that got completely choked + // in THREAD_FRAME mode (4k60 hevc, FFMpeg 7.1.1, AMD 3900x). + av->codec_context->thread_type = FF_THREAD_SLICE; log_info("Using %i threads for decoder.", cpus); } } |