Skip to content

Commit

Permalink
fix(voip-mumble): nullptr check
Browse files Browse the repository at this point in the history
This fixes a nullptr exception when trying to write to the Audio Processing Module while the audioCaptureClient is invalid.
  • Loading branch information
tens0rfl0w committed Oct 31, 2024
1 parent 37b6ac9 commit 807107e
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions code/components/voip-mumble/src/MumbleAudioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,26 @@ void MumbleAudioInput::ThreadFunc()

if (g_curInputIntentMode != g_lastIntentMode)
{
switch (g_curInputIntentMode)
{
case InputIntentMode::MUSIC:
{
m_apm->noise_suppression()->Enable(false);
m_apm->high_pass_filter()->Enable(false);
break;
}
case InputIntentMode::SPEECH:
default:
if (m_apm)
{
m_apm->noise_suppression()->Enable(true);
m_apm->high_pass_filter()->Enable(true);
break;
switch (g_curInputIntentMode)
{
case InputIntentMode::MUSIC:
{
m_apm->noise_suppression()->Enable(false);
m_apm->high_pass_filter()->Enable(false);
break;
}
case InputIntentMode::SPEECH:
default:
{
m_apm->noise_suppression()->Enable(true);
m_apm->high_pass_filter()->Enable(true);
break;
}
};
}
};

g_lastIntentMode = g_curInputIntentMode;
}

Expand Down

0 comments on commit 807107e

Please sign in to comment.