Skip to content

Commit

Permalink
UI: Hide OpenH264 from the simple mode if x264 is available
Browse files Browse the repository at this point in the history
  • Loading branch information
Conan-Kudo committed Apr 26, 2023
1 parent e8cb13a commit 766e518
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions UI/window-basic-settings-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1589,9 +1589,11 @@ void OBSBasicSettings::ResetEncoders(bool streamOnly)

#define ENCODER_STR(str) QTStr("Basic.Settings.Output.Simple.Encoder." str)

ui->simpleOutStrEncoder->addItem(ENCODER_STR("Software.OpenH264.H264"),
QString(SIMPLE_ENCODER_OPENH264));
if (service_supports_encoder(vcodecs, "obs_x264"))
if (!service_supports_encoder(vcodecs, "obs_x264"))
ui->simpleOutStrEncoder->addItem(
ENCODER_STR("Software.OpenH264.H264"),
QString(SIMPLE_ENCODER_OPENH264));
else
ui->simpleOutStrEncoder->addItem(
ENCODER_STR("Software.X264.H264"),
QString(SIMPLE_ENCODER_X264));
Expand Down
8 changes: 5 additions & 3 deletions UI/window-basic-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5295,9 +5295,11 @@ void OBSBasicSettings::FillSimpleRecordingValues()
ADD_QUALITY("HQ");
ADD_QUALITY("Lossless");

ui->simpleOutRecEncoder->addItem(ENCODER_STR("Software.OpenH264.H264"),
QString(SIMPLE_ENCODER_OPENH264));
if (EncoderAvailable("obs_x264")) {
if (!EncoderAvailable("obs_x264"))
ui->simpleOutRecEncoder->addItem(
ENCODER_STR("Software.OpenH264.H264"),
QString(SIMPLE_ENCODER_OPENH264));
else {
ui->simpleOutRecEncoder->addItem(
ENCODER_STR("Software.X264.H264"),
QString(SIMPLE_ENCODER_X264));
Expand Down

0 comments on commit 766e518

Please sign in to comment.