Reset FPS & bandwidth limits when switching video profile from custom to another one
This commit is contained in:
parent
32f4307674
commit
463ade0ade
1 changed files with 11 additions and 1 deletions
|
@ -87,7 +87,17 @@ class VideoSettingsViewModel : GenericSettingsViewModel() {
|
|||
val videoPresetListener = object : SettingListenerStub() {
|
||||
override fun onListValueChanged(position: Int) {
|
||||
videoPresetIndex.value = position // Needed to display/hide two below settings
|
||||
core.videoPreset = videoPresetLabels.value.orEmpty()[position]
|
||||
val currentPreset = core.videoPreset
|
||||
val newPreset = videoPresetLabels.value.orEmpty()[position]
|
||||
if (newPreset != currentPreset) {
|
||||
if (currentPreset == "custom") {
|
||||
// Not "custom" anymore, reset FPS & bandwidth
|
||||
core.preferredFramerate = 0f
|
||||
core.downloadBandwidth = 0
|
||||
core.uploadBandwidth = 0
|
||||
}
|
||||
core.videoPreset = newPreset
|
||||
}
|
||||
}
|
||||
}
|
||||
val videoPresetIndex = MutableLiveData<Int>()
|
||||
|
|
Loading…
Reference in a new issue