summaryrefslogtreecommitdiff
path: root/src/codec/ffmpeg
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-04-26 15:21:42 -0400
committerAndrew Opalach <andrew@akon.city> 2025-04-26 15:21:42 -0400
commit0935c234495c4945fcfd31e5f28d62218b7794d8 (patch)
tree5ff5ea0fad58a41f1c28258e6d95ba54a7311d90 /src/codec/ffmpeg
parentb1985414e54edf1eebe597551a48609ad08c6cfa (diff)
downloadcamu-0935c234495c4945fcfd31e5f28d62218b7794d8.tar.gz
camu-0935c234495c4945fcfd31e5f28d62218b7794d8.tar.bz2
camu-0935c234495c4945fcfd31e5f28d62218b7794d8.zip
Sink performance tweaks, cleanup and add notes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec/ffmpeg')
-rw-r--r--src/codec/ffmpeg/decoder.c6
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);
}
}