1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Improved WASAPI driver logic when devices are connected or disconnected

This commit is contained in:
Marcelo Fernandez
2017-10-31 13:07:35 -03:00
parent 157fa55e34
commit 16327bff8a
3 changed files with 41 additions and 16 deletions

View File

@@ -226,7 +226,7 @@ void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) {
static int total = 0;
ticks = OS::get_singleton()->get_ticks_msec();
if ((ticks - first_ticks) > 10 * 1000) {
if ((ticks - first_ticks) > 10 * 1000 && count > 0) {
print_line("Audio Driver " + String(AudioDriver::get_singleton()->get_name()) + " average latency: " + itos(total / count) + "ms (frame=" + itos(p_frames) + ")");
first_ticks = ticks;
total = 0;