From 57c4c9455ad1e5b892342433a25b056922f0f1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Fam=C3=A0?= Date: Tue, 16 Jan 2024 18:40:56 +0100 Subject: [PATCH] Fix Dummy audio driver initialization issue on WASAPI output device initialization failure --- drivers/wasapi/audio_driver_wasapi.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 668202221..d31c0ea5e 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -400,13 +400,11 @@ Error AudioDriverWASAPI::finish_capture_device() { Error AudioDriverWASAPI::init() { mix_rate = GLOBAL_GET("audio/mix_rate"); - Error err = init_render_device(); - if (err != OK) { - ERR_PRINT("WASAPI: init_render_device error"); - } - exit_thread.clear(); + Error err = init_render_device(); + ERR_FAIL_COND_V_MSG(err != OK, err, "WASAPI: init_render_device error."); + thread.start(thread_func, this); return OK;