summaryrefslogtreecommitdiff
path: root/src/codec/ffmpeg
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-05-08 12:48:07 -0400
committerAndrew Opalach <andrew@akon.city> 2025-05-08 12:48:07 -0400
commit5c059c0167f468ed4c98592b55a312143bd94b22 (patch)
tree3f0e1ac455c47f95346766613bb250a7af100f68 /src/codec/ffmpeg
parent8404c1bad9d4ac448b4b051f29446ca2f24c4ef8 (diff)
downloadcamu-5c059c0167f468ed4c98592b55a312143bd94b22.tar.gz
camu-5c059c0167f468ed4c98592b55a312143bd94b22.tar.bz2
camu-5c059c0167f468ed4c98592b55a312143bd94b22.zip
Cleanup build
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/codec/ffmpeg')
-rw-r--r--src/codec/ffmpeg/decoder.c11
-rw-r--r--src/codec/ffmpeg/demuxer.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c
index 7401698..c22d1c1 100644
--- a/src/codec/ffmpeg/decoder.c
+++ b/src/codec/ffmpeg/decoder.c
@@ -256,14 +256,15 @@ 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(4, MAX(1, cpus / 2));
+ cpus = MIN(6, MAX(1, cpus / 2));
}
if (cpus > 0) {
av->codec_context->thread_count = cpus;
- // FF_THREAD_FRAME, FF_THREAD_SLICE or both.
- // Slice seems to work better based on videos that get completely choked
- // in frame-only or both (4k60 HEVC, FFmpeg 7.1.1, AMD 3900x).
- av->codec_context->thread_type = FF_THREAD_SLICE;
+ // FF_THREAD_FRAME or FF_THREAD_SLICE.
+ // Both modes can get choked on certain videos, sometimes SLICE can squeeze
+ // out a little more performance but a higher thread_count with FRAME seems
+ // like the safest default.
+ av->codec_context->thread_type = FF_THREAD_FRAME;
log_info("Using %i threads for decoder.", cpus);
}
}
diff --git a/src/codec/ffmpeg/demuxer.c b/src/codec/ffmpeg/demuxer.c
index 4cf52dd..b539577 100644
--- a/src/codec/ffmpeg/demuxer.c
+++ b/src/codec/ffmpeg/demuxer.c
@@ -57,7 +57,7 @@ static bool ff_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handl
// FFmpeg says the avio protocol configures "buffers and access patterns".
// I think we already do enough buffering but, better access patterns for
// network streams sounds like something we want.
- s32 ret = avformat_open_input(&av->format_context, "file:", NULL, &opts);
+ s32 ret = avformat_open_input(&av->format_context, "cache:", NULL, &opts);
if (ret < 0) {
log_error("Failed to open input (%s).", av_err2str(ret));
av_dict_free(&opts);