obs-nvenc: Fix lookahead depth value logging #11816
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Log the final
lookaheadDepth
value after all calculations, instead of an intermediate value. (For Nvenc.)Motivation and Context
Without this change, a value gets logged based on an internal variable
rc_lookahead
that's not necessarily equal to the actual, final value that gets used for the encode. (e.g. It can get bounded to a lower value afterward without updating this internal variable.)Would like to show users the actual value of
lookaheadDepth
that's being used for their encode session, or at least show what's actually set on the encode session. (It's a bit unclear which values the driver actually respects / meaningfully responds to.)Thanks to @Penwy for pointing out this discrepancy.
How Has This Been Tested?
lookaheadDepth=9999
in the "Custom Encoder Options" field of an "NVIDIA NVENC H.264" encoder in the Advanced Output tab. (This is a knowingly "too-high" value.)obs-nvenc
plugin's code internally bounds this value to within some reasonable limits.Before:
After:
Note the "true (56 frames)" instead of "true (9999 frames)". This (56) is the actual value the plugin has limited/sanitized the
lookaheadDepth
value to. So, this change causes the correct (bounded) final value to be logged. Doing it this way should now survive any refactoring of the above "intermediate state"/input-sanitizing code as well.Tested on Windows 10 on a 3070, Studio Driver 561.09, FWIW.
Types of changes
Checklist: