UI: If audio bitrate not available, use closest

When an encoder has been removed (such as CoreAudio) and the audio
bitrates currently configured no longer are available to the current
audio encoders anymore, it would cause GetAACEncoderForBitrate to return
false with no encoder available.

To fix the issue, instead just choose the closest bitrate relative to
the current bitrate (rounded up).
This commit is contained in:
jp9000 committed 2015-09-21 18:49:07 -07:00
1 parent e10cf47e0d
commit 17fa004104
4 files changed
+41 -2

No files matched your search

+7
View File
@@ -1023,6 +1023,8 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
const char *recEnc = config_get_string(main->Config(), "SimpleOutput",
"RecEncoder");
audioBitrate = FindClosestAvailableAACBitrate(audioBitrate);
ui->simpleOutputPath->setText(path);
ui->simpleOutputVBitrate->setValue(videoBitrate);
@@ -1263,6 +1265,11 @@ void OBSBasicSettings::LoadAdvOutputAudioSettings()
const char *name4 = config_get_string(main->Config(), "AdvOut",
"Track4Name");
track1Bitrate = FindClosestAvailableAACBitrate(track1Bitrate);
track2Bitrate = FindClosestAvailableAACBitrate(track2Bitrate);
track3Bitrate = FindClosestAvailableAACBitrate(track3Bitrate);
track4Bitrate = FindClosestAvailableAACBitrate(track4Bitrate);
SetComboByName(ui->advOutTrack1Bitrate,
std::to_string(track1Bitrate).c_str());
SetComboByName(ui->advOutTrack2Bitrate,