From eaf8f25b12bb56a87b0b77a3f4104d2bec156b83 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Mon, 29 Jul 2024 10:43:26 +0200 Subject: [PATCH] only show video encoder index setting when multitrack video is enabled --- config-dialog.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config-dialog.cpp b/config-dialog.cpp index 67ef113..896bd3b 100644 --- a/config-dialog.cpp +++ b/config-dialog.cpp @@ -28,6 +28,7 @@ #include #include +#include #include "output-dialog.hpp" #include "config-utils.hpp" @@ -415,7 +416,8 @@ void OBSBasicSettings::AddServer(QFormLayout *outputsLayout, obs_data_t *setting auto server_title_layout = new QHBoxLayout; auto platformIconLabel = new QLabel; - auto platformIcon = ConfigUtils::getPlatformIconFromEndpoint(QString::fromUtf8(obs_data_get_string(settings, "stream_server"))); + auto platformIcon = + ConfigUtils::getPlatformIconFromEndpoint(QString::fromUtf8(obs_data_get_string(settings, "stream_server"))); platformIconLabel->setPixmap(platformIcon.pixmap(30, 30)); server_title_layout->addWidget(platformIconLabel, 0); @@ -598,7 +600,13 @@ void OBSBasicSettings::AddServer(QFormLayout *outputsLayout, obs_data_t *setting auto encoder = encoder_string.constData(); obs_data_set_string(settings, "video_encoder", encoder); if (!encoder || encoder[0] == '\0') { - videoPageLayout->setRowVisible(videoEncoderIndex, true); + if (config_get_bool(obs_frontend_get_profile_config(), "Stream1", "EnableMultitrackVideo")) { + videoPageLayout->setRowVisible(videoEncoderIndex, true); + } else { + videoPageLayout->setRowVisible(videoEncoderIndex, false); + if (videoEncoderIndex->currentIndex() != 0) + videoEncoderIndex->setCurrentIndex(0); + } videoEncoderGroup->setVisible(false); } else { videoPageLayout->setRowVisible(videoEncoderIndex, false);