diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-09-10 15:12:02 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-09-10 15:12:02 -0300 |
commit | 10a492515991d69992aadf8cb02a8ceb77176d60 (patch) | |
tree | 99c3ccdb025991dbaafa9727bb1a980288b22828 /drivers/wasapi | |
parent | db26c1205cd97c27ae658024fecc932ea6586ba4 (diff) |
Fix possible crash when switching audio device on WASAPI driver
Diffstat (limited to 'drivers/wasapi')
-rw-r--r-- | drivers/wasapi/audio_driver_wasapi.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 11abe3256e..43577a090f 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -65,7 +65,6 @@ const IID IID_IAudioCaptureClient = __uuidof(IAudioCaptureClient); #define CAPTURE_BUFFER_CHANNELS 2 -static StringName capture_device_id; static bool default_render_device_changed = false; static bool default_capture_device_changed = false; @@ -128,7 +127,6 @@ public: default_render_device_changed = true; } else if (flow == eCapture) { default_capture_device_changed = true; - capture_device_id = String(pwstrDeviceId); } } @@ -659,6 +657,9 @@ void AudioDriverWASAPI::thread_func(void *p_udata) { if (err == OK) { ad->start(); } + + avail_frames = 0; + write_ofs = 0; } if (ad->audio_input.active) { |