diff options
Diffstat (limited to 'src/codec')
| -rw-r--r-- | src/codec/ffmpeg/decoder.c | 11 | ||||
| -rw-r--r-- | src/codec/ffmpeg/demuxer.c | 2 |
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); |