0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Set preferHardware only when hw encoder is avail.

streamPage->ui->preferHardware doesn't exist if hw encoder is not
available

Closes obsproject/obs-studio#1665
This commit is contained in:
craftwar 2019-02-15 21:45:33 +08:00 committed by jp9000
parent 1f317fb80a
commit ed0908567c

View File

@ -818,14 +818,15 @@ AutoConfig::AutoConfig(QWidget *parent)
if (!hardwareEncodingAvailable) {
delete streamPage->ui->preferHardware;
streamPage->ui->preferHardware = nullptr;
} else {
/* Newer generations of NVENC have a high enough quality to
* bitrate ratio that if NVENC is available, it makes sense to
* just always prefer hardware encoding by default */
bool preferHardware = nvencAvailable ||
os_get_physical_cores() <= 4;
streamPage->ui->preferHardware->setChecked(preferHardware);
}
/* Newer generations of NVENC have a high enough quality to bitrate
* ratio that if NVENC is available, it makes sense to just always
* prefer hardware encoding by default */
bool preferHardware = nvencAvailable || os_get_physical_cores() <= 4;
streamPage->ui->preferHardware->setChecked(preferHardware);
setOptions(0);
setButtonText(QWizard::FinishButton,
QTStr("Basic.AutoConfig.ApplySettings"));