summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2009-10-06 22:40:14 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2009-10-06 22:40:14 (GMT)
commit3865912d4a6c31a4981e1831e2af8d59f3eb4ac0 (patch)
tree5ede5902152b25c9bfc570db5ef4cd1d1f747a96 /src
parent2d2b4e8a77a30449d8b4ebc88979b3aff45a8222 (diff)
downloadQt-3865912d4a6c31a4981e1831e2af8d59f3eb4ac0.zip
Qt-3865912d4a6c31a4981e1831e2af8d59f3eb4ac0.tar.gz
Qt-3865912d4a6c31a4981e1831e2af8d59f3eb4ac0.tar.bz2
Fixed thread lockup in win32 backend for QAudioOutput.
-Was not closing the WaveOut on cleanup, fixed. -Was emitting signal in critical section, fixed. Reviewed-by:Bill King
Diffstat (limited to 'src')
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index ef4bf0e..2c4a1c2 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -189,7 +189,6 @@ void QAudioOutputPrivate::stop()
{
if(deviceState == QAudio::StopState)
return;
- deviceState = QAudio::StopState;
close();
if(!pullMode && audioSource) {
delete audioSource;
@@ -465,13 +464,15 @@ bool QAudioOutputPrivate::deviceReady()
} else if(l == 0) {
bytesAvailable = bytesFree();
+ int check = 0;
EnterCriticalSection(&waveOutCriticalSection);
- if(waveFreeBlockCount == buffer_size/period_size) {
+ check = waveFreeBlockCount;
+ LeaveCriticalSection(&waveOutCriticalSection);
+ if(check == buffer_size/period_size) {
errorState = QAudio::UnderrunError;
deviceState = QAudio::IdleState;
emit stateChanged(deviceState);
}
- LeaveCriticalSection(&waveOutCriticalSection);
} else if(l < 0) {
bytesAvailable = bytesFree();