From e9e93a2a1378fc3dfc8b654dd27c3c5059f2fe0b Mon Sep 17 00:00:00 2001 From: "Huts, Roman" <71274498+rhutsAMD@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:31:06 -0500 Subject: [PATCH] obs-ffmpeg: Fix throughput checks for older AMD driver --- plugins/obs-ffmpeg/texture-amf.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/obs-ffmpeg/texture-amf.cpp b/plugins/obs-ffmpeg/texture-amf.cpp index efe2d154f37eda..5b837d0fad9879 100644 --- a/plugins/obs-ffmpeg/texture-amf.cpp +++ b/plugins/obs-ffmpeg/texture-amf.cpp @@ -422,6 +422,7 @@ static inline void check_preset_compatibility(amf_base *enc, const char *&preset * encoder properties. If the throughput is lower than the max * throughput, switch to a lower preset. */ + refresh_throughput_caps(enc, preset); if (astrcmpi(preset, "highQuality") == 0) { if (!enc->max_throughput) { preset = "quality"; @@ -447,9 +448,14 @@ static inline void check_preset_compatibility(amf_base *enc, const char *&preset } if (astrcmpi(preset, "balanced") == 0) { - if (enc->max_throughput && enc->max_throughput - enc->requested_throughput < enc->throughput) { + if (!enc->max_throughput) { preset = "speed"; - refresh_throughput_caps(enc, preset); + set_opt(QUALITY_PRESET, get_preset(enc, preset)); + } else { + if (enc->max_throughput - enc->requested_throughput < enc->throughput) { + preset = "speed"; + refresh_throughput_caps(enc, preset); + } } } }