Fix hang in tst_qaudioinput (Windows).

Task-number: QTBUG-28731

Change-Id: Iebe598f9e0760b05d05d5a6b6ecbeb535e745e2c
Reviewed-by: Jonas Rabbe <jonas.rabbe@gmail.com>
This commit is contained in:
Friedemann Kleint
2013-04-11 09:45:50 +02:00
committed by The Qt Project
parent 3d848f05ad
commit f2af807c5b

View File

@@ -767,9 +767,9 @@ void tst_QAudioInput::pushSuspendResume()
QVERIFY(audioInput.processedUSecs() == processedUs);
// Drain any data, in case we run out of space when resuming
while (audioInput.bytesReady() >= audioInput.periodSize()) {
const int reads = audioInput.bytesReady() / audioInput.periodSize();
for (int r = 0; r < reads; ++r)
feed->read(buffer.data(), audioInput.periodSize());
}
audioInput.resume();