Skip to content

Commit

Permalink
FIX(client): Default echo cancel setting not loaded correctly
Browse files Browse the repository at this point in the history
613a5d5 introuced a compatibility layer
for porting over the old echo cancel settings to the new one. However by
doing so it prevented the default setting (Speex mixed) from being
loaded properly as in this case it is not saved explicitly. This would
lead to the compat block being executed that would disable echo
cancelling if there are no old settings.

This commit fixes this by making sure the compat block is only run when
the old setting is actually present.

Fixes #4761
  • Loading branch information
Krzmbrzl committed Feb 16, 2021
1 parent d322311 commit 452107d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/mumble/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,20 +780,22 @@ void Settings::load(QSettings *settings_ptr) {
// This block should only be called once at the first start of the new Mumble version
// As echo cancellation was not available on macOS before, we don't have to run this compatibility
// code on macOS (instead simply use the new default as set in the constructor).
bool deprecatedEcho = false;
bool deprecatedEchoMulti = false;
if (settings_ptr->contains("audio/echo")) {
bool deprecatedEcho = false;
bool deprecatedEchoMulti = false;

SAVELOAD(deprecatedEcho, "audio/echo");
SAVELOAD(deprecatedEchoMulti, "audio/echomulti");
SAVELOAD(deprecatedEcho, "audio/echo");
SAVELOAD(deprecatedEchoMulti, "audio/echomulti");

if (deprecatedEcho) {
if (deprecatedEchoMulti) {
echoOption = EchoCancelOptionID::SPEEX_MULTICHANNEL;
if (deprecatedEcho) {
if (deprecatedEchoMulti) {
echoOption = EchoCancelOptionID::SPEEX_MULTICHANNEL;
} else {
echoOption = EchoCancelOptionID::SPEEX_MIXED;
}
} else {
echoOption = EchoCancelOptionID::SPEEX_MIXED;
echoOption = EchoCancelOptionID::DISABLED;
}
} else {
echoOption = EchoCancelOptionID::DISABLED;
}
#endif
}
Expand Down Expand Up @@ -1013,6 +1015,8 @@ void Settings::load(QSettings *settings_ptr) {
settings_ptr->beginGroup(QLatin1String("overlay"));
os.load(settings_ptr);
settings_ptr->endGroup();

qDebug() << "Echo option loaded to" << static_cast<int>(echoOption);
}

#undef SAVELOAD
Expand Down

0 comments on commit 452107d

Please sign in to comment.