diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-04-19 02:25:56 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-04-19 02:25:56 (GMT) |
commit | 9ddb31289ac123472c300efdba28c903a8be7a07 (patch) | |
tree | 13b5ff26ba84ce58a1c4536953a485cef07c4b89 /src/multimedia | |
parent | 544bbfadc0703597b7084213261053ca0e2facf6 (diff) | |
download | Qt-9ddb31289ac123472c300efdba28c903a8be7a07.zip Qt-9ddb31289ac123472c300efdba28c903a8be7a07.tar.gz Qt-9ddb31289ac123472c300efdba28c903a8be7a07.tar.bz2 |
Bug in QAudioOutput: Invalid use of "waveOutUnprepareHeader"
Fixed freeBlocks func in both input and output
Task-number:QTBUG-9875
Reviewed-by:Andrew den Exter
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/audio/qaudioinput_win32_p.cpp | 3 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_win32_p.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index df469d7..5152d9a 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -156,7 +156,8 @@ void QAudioInputPrivate::freeBlocks(WAVEHDR* blockArray) int count = buffer_size/period_size; for(int i = 0; i < count; i++) { - waveInUnprepareHeader(hWaveIn,&blocks[i], sizeof(WAVEHDR)); + if (blocks->dwFlags & WHDR_PREPARED) + waveInUnprepareHeader(hWaveIn,blocks, sizeof(WAVEHDR)); blocks+=sizeof(WAVEHDR); } HeapFree(GetProcessHeap(), 0, blockArray); diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index e818723..b92565d 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -150,7 +150,8 @@ void QAudioOutputPrivate::freeBlocks(WAVEHDR* blockArray) int count = buffer_size/period_size; for(int i = 0; i < count; i++) { - waveOutUnprepareHeader(hWaveOut,&blocks[i], sizeof(WAVEHDR)); + if (blocks->dwFlags & WHDR_PREPARED) + waveOutUnprepareHeader(hWaveOut,blocks, sizeof(WAVEHDR)); blocks+=sizeof(WAVEHDR); } HeapFree(GetProcessHeap(), 0, blockArray); |