Skip to content

Commit d41167f

Browse files
committed
fix
1 parent 7dca925 commit d41167f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/audio/audio.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ void audio::initialize(bool enabled, AudioSettings& settings) {
184184
}
185185

186186
input_device = backend->openInputDevice(44100, 1, 16);
187-
input_device->startCapture();
187+
if (input_device) {
188+
input_device->startCapture();
189+
}
188190
}
189191

190192
InputDevice* audio::get_input_device() {
@@ -467,7 +469,9 @@ void audio::reset_channel(int index) {
467469
}
468470

469471
void audio::close() {
470-
input_device->stopCapture();
472+
if (input_device) {
473+
input_device->stopCapture();
474+
}
471475
speakers.clear();
472476
delete backend;
473477
backend = nullptr;

0 commit comments

Comments
 (0)