Improve UI behavior when available codecs/settings change#12326
Open
hoshinolina wants to merge 2 commits intoobsproject:masterfrom
Open
Improve UI behavior when available codecs/settings change#12326hoshinolina wants to merge 2 commits intoobsproject:masterfrom
hoshinolina wants to merge 2 commits intoobsproject:masterfrom
Conversation
0484910 to
076165b
Compare
If the previous selection is no longer available, the UI would default to the first index, but not allow the user to save the change (which then becomes impossible to save if the setting only has one possible value, since you can never trigger the "changed" status). If the settings load process clamped any setting to the default, enable the apply button and consider the setting changed.
The combo box is only visible if quality isn't "Stream", so otherwise an invalid/missing selection cannot be corrected. Only do the check when it's relevant.
5b2ae62 to
22cb8ef
Compare
Member
|
This is a good description of the problem (and definitely something on our radar as an issue worth fixing) but as this is difficult to test on Windows, how exactly does this change the UI flow? The description of the change describes the problem, but not what this solution actually does or how it solves the problem. |
Contributor
Author
|
Before: If the encoder is unavailable, opening the settings dialog would show another (available) encoder already selected, but the setting cannot be saved ("Apply" is grayed out).
After: The "Apply" button is active as soon as you open the settings dialog (indicating that something already changed to fit constraints), and clicking it or OK will set the encoder to the new default (which is already what was visible to the user in the settings pane).
The second commit is just a trivial bugfix to stop it from prompting you about an incorrect setting when the setting is hidden and irrelevant. It just resolves a confusing situation.
If you want to test this, the easiest way is to just edit the profile config file manually and set any of the encoder settings to an invalid/nonexistent identifier.
~~ Lina
|
6 tasks
Lain-B
approved these changes
Jul 12, 2025
Member
|
We should use the existing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
When a codec becomes available or unavailable (e.g. if a plugin is added or removed), make it possible to correct the setting in the UI. Currently, when this happens, it can be impossible to change to a different encoder/setting entirely, leaving the profile broken.
Motivation and Context
I stumbled upon this in the context of #8529, but the fixes apply more generally. If the x264 plugin (which is a separate RPM Fusion package in the Fedora world) is installed, OpenH264 is hidden from the simple encoder settings, but if x264 is the only encoder choice, there's no way to "change" the codec in the combo box, so the codec in the profile config remains stuck at OpenH264 while the UI says the codec is x264. Conversely, if the x264 plugin is removed, the profile becomes invalid and unusable, but there's no way to correct the codec in the simple encoder settings UI if OpenH264 becomes the only option. This also applies to the advanced settings when x264 is removed (the combo box defaults to OpenH264 but it's not evident this can be saved without flipping through the codecs at least once).
In addition, if the recording codec is set to x264 and the plugin is removed, the UI refuses to save settings because the recording codec combo box is unselected. However, if the quality is set to "same as stream", then that setting is actually irrelevant. Fix it so that the error only appears if the quality is not "same as stream" (at which point the combo box clearly prompts the user to select a codec).
Although this change was discovered in the context of #8529, it should apply to other scenarios too with e.g. hardware codecs becoming available or unavailable for whatever reason.
Note: This still requires the user to go through a trip into codec settings when a codec choice is invalidated (recording/streaming will fail to start until this). I think this is better behavior than silently changing settings on startup, since then simply opening OBS with an incomplete install could change the user's profile without their knowledge, and the change would stick after the installation issue is resolved, which is unexpected silent behavior. I think it's better to explicitly tell the user there's a problem with their existing config, and require them to open up the settings, even if the only thing they have to do then is click "apply" to actually commit to the new default.
How Has This Been Tested?
Local build & tested all the scenarios of removing and adding back the x264 plugin.
Types of changes
Checklist: