Skip to content

Commit

Permalink
UI: Fix crash when no audio backends are available
Browse files Browse the repository at this point in the history
This commit prevents a crash in, for example, Linux configurations
where PulseAudio is disabled, which leads into 'mod' being 'null',
which in turn leads into a segmentation fault when an ALSA source
is selected.

Closes obsproject#3485
  • Loading branch information
Chiitoo authored and 1div0 committed Apr 22, 2021
1 parent fdf736b commit a66c144
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UI/context-bar-controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ void AudioCaptureToolbar::Init()

obs_module_t *mod =
get_os_module("win-wasapi", "mac-capture", "linux-pulseaudio");
if (!mod) {
return;
}

const char *device_str =
get_os_text(mod, "Device", "CoreAudio.Device", "Device");
ui->deviceLabel->setText(device_str);
Expand Down

0 comments on commit a66c144

Please sign in to comment.