UI: Fix crash when no audio backends are available
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 https://github.com/obsproject/obs-studio/issues/3485master
parent
bb264b2b33
commit
41367bb2b4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue