From f135b6f28a23a07d8d863eb9c6e0f5f762dff6ce Mon Sep 17 00:00:00 2001 From: spacy51 Date: Sat, 5 Apr 2008 01:49:15 +0000 Subject: [PATCH] XAudio2 will now output a warning to the log window, when the buffers ran dry. Debug build only. --- src/win32/XAudio2.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/win32/XAudio2.cpp b/src/win32/XAudio2.cpp index 0b4f9f82..d9a4b806 100644 --- a/src/win32/XAudio2.cpp +++ b/src/win32/XAudio2.cpp @@ -255,6 +255,13 @@ void XAudio2_Output::write() if( vState.BuffersQueued < NBUFFERS ) { // there is at least one free buffer +#ifdef _DEBUG + if( vState.BuffersQueued == 0 ) { + // buffers ran dry + static int i = 0; + log( "XAudio2: Buffers were not refilled fast enough (%i)\n", i++ ); + } +#endif break; } else { // the maximum number of buffers is currently queued