summaryrefslogtreecommitdiff
path: root/drivers/wasapi
diff options
context:
space:
mode:
authorSaracen <SaracenOne@gmail.com>2018-07-27 05:43:22 +0100
committerSaracen <SaracenOne@gmail.com>2018-07-27 16:50:13 +0100
commit0a877b58b8adb08ab137393b84036b8be94097ca (patch)
tree4ad08438fb6f8b9340c9a4125de7c89b9c96700c /drivers/wasapi
parentaca6e291d64fcbd253ea9c34756db6f8c6915c72 (diff)
Reset audio input during render device change to keep synchronisation.
Diffstat (limited to 'drivers/wasapi')
-rw-r--r--drivers/wasapi/audio_driver_wasapi.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp
index f4d0d3c1dc..b641e213a8 100644
--- a/drivers/wasapi/audio_driver_wasapi.cpp
+++ b/drivers/wasapi/audio_driver_wasapi.cpp
@@ -320,6 +320,9 @@ Error AudioDriverWASAPI::init_render_device(bool reinit) {
// Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels)
samples_in.resize(buffer_frames * channels);
+ audio_input_position = 0;
+ audio_input_size = 0;
+
if (OS::get_singleton()->is_stdout_verbose()) {
print_line("WASAPI: detected " + itos(channels) + " channels");
print_line("WASAPI: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");