Merge remote-tracking branch 'origin/5.5' into 5.6

Change-Id: I01940fe4f3d059fbb425492a1748e2b5d9b6804b
This commit is contained in:
Liang Qi
2016-01-19 09:50:11 +01:00
6 changed files with 8 additions and 10 deletions

View File

@@ -353,7 +353,8 @@ void PrivateSoundSource::stateChanged(QAudio::State state)
#ifdef QT_QAUDIO_DEBUG
qDebug() << this << "stateChanged " << state;
#endif
if (state == QAudio::IdleState && m_runningCount == 0)
if ((state == QAudio::IdleState && m_runningCount == 0)
|| (state == QAudio::StoppedState && m_audioOutput->error() != QAudio::NoError))
emit soundeffect->stop();
}

View File

@@ -90,7 +90,7 @@ void QT_WIN_CALLBACK QWindowsAudioInput::waveInProc( HWAVEIN hWaveIn, UINT uMsg,
if(!qAudio)
return;
QMutexLocker(&qAudio->mutex);
QMutexLocker locker(&qAudio->mutex);
switch(uMsg) {
case WIM_OPEN:

View File

@@ -90,7 +90,7 @@ void CALLBACK QWindowsAudioOutput::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
if(!qAudio)
return;
QMutexLocker(&qAudio->mutex);
QMutexLocker locker(&qAudio->mutex);
switch(uMsg) {
case WOM_OPEN:

View File

@@ -702,11 +702,11 @@ void tst_QAudioOutput::push()
QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after receiving data");
QVERIFY2((audioOutput.error() == QAudio::NoError), "error state is not equal to QAudio::NoError after receiving data");
firstBuffer = false;
stateSignal.clear();
}
} else
QTest::qWait(20);
}
stateSignal.clear();
// Wait until playback finishes
QTest::qWait(3000); // 3 seconds should be plenty

View File

@@ -134,7 +134,6 @@ Item {
verify(sound1.muted == false)
verify(sound1.playing == false)
verify(sound1.status == 1) // Status.Loading
verify(sound1.category == "")
}
function test_muting() {

View File

@@ -150,8 +150,7 @@ void tst_QSoundEffect::testLooping()
QCOMPARE(readSignal_Remaining.count(), 0);
sound->play();
QCOMPARE(sound->loopsRemaining(), 5);
QCOMPARE(readSignal_Remaining.count(), 1);
QVERIFY(readSignal_Remaining.count() > 0);
// test.wav is about 200ms, wait until it has finished playing 5 times
QTestEventLoop::instance().enterLoop(3);
@@ -172,11 +171,10 @@ void tst_QSoundEffect::testLooping()
QCOMPARE(readSignal_Remaining.count(), 0);
sound->play();
QCOMPARE(sound->loopsRemaining(), 30);
QCOMPARE(readSignal_Remaining.count(), 1);
QVERIFY(readSignal_Remaining.count() > 0);
// wait for the sound to be played several times
QTRY_COMPARE(sound->loopsRemaining(), 20);
QTRY_VERIFY(sound->loopsRemaining() <= 20);
QVERIFY(readSignal_Remaining.count() >= 10);
readSignal_Count.clear();
readSignal_Remaining.clear();