src/multimedia/audio/qaudiooutput_win32_p.cpp
changeset 22 79de32ba3296
parent 19 fcece45ef507
child 23 89e065397ea6
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp	Mon May 03 13:17:34 2010 +0300
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp	Fri May 14 16:40:13 2010 +0300
@@ -56,8 +56,6 @@
 
 QT_BEGIN_NAMESPACE
 
-static CRITICAL_SECTION waveOutCriticalSection;
-
 static const int minimumIntervalTime = 50;
 
 QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
@@ -107,16 +105,16 @@
         case WOM_CLOSE:
             return;
         case WOM_DONE:
-            EnterCriticalSection(&waveOutCriticalSection);
+            EnterCriticalSection(&qAudio->waveOutCriticalSection);
             if(qAudio->finished || qAudio->buffer_size == 0 || qAudio->period_size == 0) {
-                LeaveCriticalSection(&waveOutCriticalSection);
+                LeaveCriticalSection(&qAudio->waveOutCriticalSection);
                 return;
 	    }
             qAudio->waveFreeBlockCount++;
             if(qAudio->waveFreeBlockCount >= qAudio->buffer_size/qAudio->period_size)
                 qAudio->waveFreeBlockCount = qAudio->buffer_size/qAudio->period_size;
             qAudio->feedback();
-            LeaveCriticalSection(&waveOutCriticalSection);
+            LeaveCriticalSection(&qAudio->waveOutCriticalSection);
             break;
         default:
             return;