Skip to content

Commit

Permalink
obs-ffmpeg: Fix throughput checks for older AMD driver
Browse files Browse the repository at this point in the history
  • Loading branch information
rhutsAMD committed Jan 13, 2025
1 parent 48dad45 commit e9e93a2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/obs-ffmpeg/texture-amf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
}
}
}
}
Expand Down

0 comments on commit e9e93a2

Please sign in to comment.