From 0521766417eef7f92eb8078b3b83e5473e00484e Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 11 Jan 2016 00:02:54 +0000 Subject: Fix usage of QMutexLocker, destroy it only at end of scope Change-Id: I8b47d49f7a83a71a1b90ab57ee7bc3791ef59667 Reviewed-by: Marc Mutz Reviewed-by: Yoann Lopes --- src/plugins/windowsaudio/qwindowsaudioinput.cpp | 2 +- src/plugins/windowsaudio/qwindowsaudiooutput.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/windowsaudio/qwindowsaudioinput.cpp b/src/plugins/windowsaudio/qwindowsaudioinput.cpp index 788db2d25..72978aecb 100644 --- a/src/plugins/windowsaudio/qwindowsaudioinput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudioinput.cpp @@ -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: diff --git a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp index 68e58646d..7e2205dea 100644 --- a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp @@ -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: -- cgit v1.2.3 From ba847185e2b0dfaa39fddb9845ad7208b0d1018d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Mon, 11 Jan 2016 17:20:29 +0200 Subject: Remove checking exact remaining loop amount right after calling play() Depending on platform it is unknown how many times it has already been actually playing the audio. Change-Id: I27b65cee8de5f9f75ceda277ee22d86f7897ce7b Reviewed-by: Yoann Lopes --- tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp index 642c00ceb..e8ea3a487 100644 --- a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp +++ b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp @@ -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,8 +171,7 @@ 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); -- cgit v1.2.3 From 481dd30e2f62e6179fbb95d6b7a667813338dd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Mon, 11 Jan 2016 13:42:00 +0200 Subject: Remove testing category to empty string Not all backends have empty default category Change-Id: I55025bf213063c5fd64dd5be4031aabf3a148a7b Reviewed-by: Yoann Lopes --- tests/auto/integration/qml/soundeffect/tst_soundeffect.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml b/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml index 17908af94..f39dc1f75 100644 --- a/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml +++ b/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml @@ -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() { -- cgit v1.2.3 From dd0fa191ffa22adc2e5a8a08293aea918780b6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Wed, 13 Jan 2016 14:44:12 +0200 Subject: Fix clearing signals already send after first part of audio data Previous place for clearing received signal could errounsely clear already sent signal which causes next signalState comparison to fail on some platform. Change-Id: Iaffdbbcab1ec9afa0be6f1f7b7aee62b981ee319 Reviewed-by: Yoann Lopes --- tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp index 81aa97d91..07043e9ce 100755 --- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp @@ -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 -- cgit v1.2.3 From 8d88f172b691021d947385387f809a710dab23df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Mon, 11 Jan 2016 16:58:37 +0200 Subject: Fix setting state to not playing when audio error occurred Even if QAudioOutput has finished playing audio state don't change to stopped because QSoundEffect checks only QAudio::IdleState as when to stop itself. Change-Id: Iea3a4926c87ea5a7b440e62d832bbc13bcdd3b6d Reviewed-by: Yoann Lopes --- src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index 77ed48b4a..adb334dd6 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -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(); } -- cgit v1.2.3 From f69a0516754ec2c6f1448fd3deac8d34bc35eb73 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 18 Jan 2016 12:19:53 +0100 Subject: Fix tst_QVideoWidget. Make sure the tested QVideoWidget has a valid size. Since 7b63c45d in qtbase, native widgets are required to have a valid size to be shown. This test relies on qWaitForWindowExposed() to work correctly, which means the widget must be shown and thus must have a valid size. Change-Id: I13bc1536d788d9ba56b4dcbf0c60851b5634be9e Reviewed-by: Simon Hausmann --- tests/auto/unit/qvideowidget/tst_qvideowidget.cpp | 103 +++++++++------------- 1 file changed, 42 insertions(+), 61 deletions(-) diff --git a/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp b/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp index 2f84de03f..8dd1f39f4 100644 --- a/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp +++ b/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp @@ -114,6 +114,17 @@ private: Q_DECLARE_METATYPE(Qt::AspectRatioMode) Q_DECLARE_METATYPE(const uchar *) +class QtTestVideoWidget : public QVideoWidget +{ +public: + QtTestVideoWidget(QWidget *parent = 0) + : QVideoWidget(parent) + { + setWindowFlags(Qt::X11BypassWindowManagerHint); + resize(320, 240); + } +}; + class QtTestWindowControl : public QVideoWindowControl { public: @@ -339,8 +350,7 @@ public: void tst_QVideoWidget::nullObject() { - QVideoWidget widget; - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); + QtTestVideoWidget widget; QVERIFY(widget.sizeHint().isEmpty()); @@ -425,11 +435,9 @@ void tst_QVideoWidget::nullService() { QtTestVideoObject object(0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); - QVERIFY(widget.sizeHint().isEmpty()); widget.show(); @@ -459,9 +467,8 @@ void tst_QVideoWidget::noOutputs() { QtTestVideoObject object(0, 0, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QVERIFY(widget.sizeHint().isEmpty()); @@ -489,9 +496,8 @@ void tst_QVideoWidget::serviceDestroyed() QtTestVideoObject object(new QtTestWindowControl, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -526,16 +532,14 @@ void tst_QVideoWidget::objectDestroyed() new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object->bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(object->testService->windowRef, 0); QCOMPARE(object->testService->widgetRef, 1); QCOMPARE(object->testService->rendererRef, 0); widget.show(); - QVERIFY(QTest::qWaitForWindowExposed(&widget)); widget.setBrightness(100); widget.setContrast(100); @@ -569,8 +573,7 @@ void tst_QVideoWidget::setMediaObject() QtTestVideoObject widgetObject(0, new QtTestWidgetControl, 0); QtTestVideoObject rendererObject(0, 0, new QtTestRendererControl); - QVideoWidget widget; - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); + QtTestVideoWidget widget; widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -622,9 +625,8 @@ void tst_QVideoWidget::showWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setNativeSize(QSize(240, 180)); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -648,9 +650,8 @@ void tst_QVideoWidget::showWidgetControl() #endif QtTestVideoObject object(0, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -672,9 +673,8 @@ void tst_QVideoWidget::showRendererControl() #endif QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -693,9 +693,8 @@ void tst_QVideoWidget::aspectRatioWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setAspectRatioMode(Qt::IgnoreAspectRatio); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); // Test the aspect ratio defaults to keeping the aspect ratio. QCOMPARE(widget.aspectRatioMode(), Qt::KeepAspectRatio); @@ -729,9 +728,8 @@ void tst_QVideoWidget::aspectRatioWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setAspectRatioMode(Qt::IgnoreAspectRatio); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); // Test the aspect ratio defaults to keeping the aspect ratio. QCOMPARE(widget.aspectRatioMode(), Qt::KeepAspectRatio); @@ -764,9 +762,8 @@ void tst_QVideoWidget::aspectRatioRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); // Test the aspect ratio defaults to keeping the aspect ratio. QCOMPARE(widget.aspectRatioMode(), Qt::KeepAspectRatio); @@ -801,9 +798,8 @@ void tst_QVideoWidget::sizeHintWindowControl() QFETCH(QSize, size); QtTestVideoObject object(new QtTestWindowControl, 0, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -822,9 +818,8 @@ void tst_QVideoWidget::sizeHintWidgetControl() QFETCH(QSize, size); QtTestVideoObject object(0, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -877,9 +872,8 @@ void tst_QVideoWidget::sizeHintRendererControl() QFETCH(QSize, expectedSize); QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -897,7 +891,7 @@ void tst_QVideoWidget::sizeHintRendererControl() void tst_QVideoWidget::fullScreenWindowControl() { QtTestVideoObject object(new QtTestWindowControl, 0, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); widget.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -982,7 +976,7 @@ void tst_QVideoWidget::fullScreenWidgetControl() #endif QtTestVideoObject object(0, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); widget.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1068,7 +1062,7 @@ void tst_QVideoWidget::fullScreenRendererControl() #endif QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); widget.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1164,9 +1158,8 @@ void tst_QVideoWidget::brightnessWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setBrightness(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1209,9 +1202,8 @@ void tst_QVideoWidget::brightnessWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setBrightness(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.brightness(), 0); @@ -1248,9 +1240,8 @@ void tst_QVideoWidget::brightnessRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1275,9 +1266,8 @@ void tst_QVideoWidget::contrastWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setContrast(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.contrast(), 0); @@ -1317,9 +1307,8 @@ void tst_QVideoWidget::contrastWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setContrast(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.contrast(), 0); widget.show(); @@ -1356,9 +1345,8 @@ void tst_QVideoWidget::contrastRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1383,9 +1371,8 @@ void tst_QVideoWidget::hueWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setHue(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.hue(), 0); widget.show(); @@ -1424,9 +1411,8 @@ void tst_QVideoWidget::hueWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setHue(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.hue(), 0); widget.show(); @@ -1463,9 +1449,8 @@ void tst_QVideoWidget::hueRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1490,9 +1475,8 @@ void tst_QVideoWidget::saturationWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setSaturation(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.saturation(), 0); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1530,9 +1514,8 @@ void tst_QVideoWidget::saturationWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setSaturation(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.saturation(), 0); widget.show(); @@ -1570,9 +1553,8 @@ void tst_QVideoWidget::saturationRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); QSignalSpy spy(&widget, SIGNAL(saturationChanged(int))); @@ -1597,9 +1579,8 @@ void tst_QVideoWidget::paintRendererControl() { QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.resize(640,480); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); -- cgit v1.2.3 From 752c1f0077c5f8361d9a166b8caaf7bff25562c1 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 12 Jan 2016 15:13:08 +0100 Subject: winrt: Fix crash in debug mode In debug mode we try to set the D3D11_CREATE_DEVICE_DEBUG flag to gather additional information for debugging purposes. However, some devices do not provide those and the D3D11CreateDevice call fails. Instead, try to create a hardware non-debug device first before going into the last software-mode fallback. Task-number: QTBUG-49488 Change-Id: I2d91b5f54f7fd818103bd106314b8503e5759159 Reviewed-by: Samuel Nevala Reviewed-by: Oliver Wolff --- src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp index cf62843f7..7dd2e6557 100644 --- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp +++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp @@ -86,6 +86,14 @@ struct QWinRTVideoRendererControlGlobal hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, &device, &featureLevel, &context); +#ifdef _DEBUG + if (FAILED(hr)) { + qErrnoWarning(hr, "Failed to create D3D device with device debug flag"); + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, + featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, + &device, &featureLevel, &context); + } +#endif if (FAILED(hr)) qErrnoWarning(hr, "Failed to create D3D device"); -- cgit v1.2.3 From 406f76b90342bfcfb982ea40a2c3141dc8556dbd Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 18 Jan 2016 14:17:24 +0100 Subject: Windows: fix build with -opengl desktop. Task-number: QTBUG-50510 Change-Id: Ide1b58061d0fcdd5caf8597af8cfaec2483d712b Reviewed-by: Karsten Heimrich --- src/plugins/common/evr/evrd3dpresentengine.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/common/evr/evrd3dpresentengine.h b/src/plugins/common/evr/evrd3dpresentengine.h index f3bbb8b3e..b5ed4fb6c 100644 --- a/src/plugins/common/evr/evrd3dpresentengine.h +++ b/src/plugins/common/evr/evrd3dpresentengine.h @@ -34,13 +34,14 @@ #ifndef EVRD3DPRESENTENGINE_H #define EVRD3DPRESENTENGINE_H -#include #include -#include #include +#include + #if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC) -#define MAYBE_ANGLE +# include +# define MAYBE_ANGLE #endif QT_BEGIN_NAMESPACE -- cgit v1.2.3 From 8d84a30e4d5ebec6e9c921ca855fc0cc5f1d9269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Thu, 14 Jan 2016 15:56:00 +0200 Subject: Be more permissive in QSoundEffect integration test. Change-Id: I9f92fda79bb359f8fa53aa11b9b6889cd35fcb6e Reviewed-by: Yoann Lopes --- tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp index e8ea3a487..604607ab0 100644 --- a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp +++ b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp @@ -174,7 +174,7 @@ void tst_QSoundEffect::testLooping() 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(); -- cgit v1.2.3 From c9a841a37614cc2b4f70df935fc097d4627f04a3 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 18 Jan 2016 15:52:14 +0100 Subject: winrt: Fix playback of files The backend uses triple buffering in the background to prefetch some buffers. However, at some point it tries to invoke SetCurrentPosition beyond the end of the file. MSDN states that for IMFByteStream one should return E_INVALIDARG, but that has negative sideeffects. What happens is that immediately MF_MEDIA_ENGINE_ERR_DECODE is sent causing the playback to stop, even if there are still valid buffers in the queue. The example in the bug reports causes up to 5 seconds of playback to be lost. This can also be reproduced with larger files. To circumvent this, return S_FALSE instead to still notify that seeking in the buffer did not work. Task-number: QTBUG-49236 Change-Id: Id4b093bf9480f5d02c7f9191fa4424f51c60e078 Reviewed-by: Andrew Knight Reviewed-by: Simon Hausmann --- src/plugins/winrt/qwinrtmediaplayercontrol.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/winrt/qwinrtmediaplayercontrol.cpp b/src/plugins/winrt/qwinrtmediaplayercontrol.cpp index ed2dbb943..d00788e64 100644 --- a/src/plugins/winrt/qwinrtmediaplayercontrol.cpp +++ b/src/plugins/winrt/qwinrtmediaplayercontrol.cpp @@ -388,8 +388,13 @@ public: HRESULT __stdcall SetCurrentPosition(QWORD position) { qint64 pos(position); - if (pos >= d->stream->size()) - return E_INVALIDARG; + if (pos >= d->stream->size()) { + // MSDN states we should return E_INVALIDARG, but that immediately + // stops playback and does not play remaining buffers in the queue. + // For some formats this can cause losing up to 5 seconds of the + // end of the stream. + return S_FALSE; + } const bool ok = d->stream->seek(pos); return ok ? S_OK : S_FALSE; -- cgit v1.2.3 From b4d03dc82f6d282582dda2137fadd54f97d3b9a7 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 25 Nov 2015 16:27:08 +0100 Subject: GStreamer: fix GstAppSrc usage. Allow our GstAppSrc wrapper to be reconfigured with a new GstAppSrc object. This is necessary because that object changes every time playback is restarted, even for the same source. The consequence of not allowing the reconfigure was that playback for a given qrc media would only work the first time; any subsequent calls to play() would not work since our wrapper wouldn't know about the new GstAppSrc object and therefore wouldn't be able to produce any data. Also improved management of the wrapper lifecycle. Task-number: QTBUG-49531 Change-Id: I905afb6848cc7e9a563b4edc2c5875cdd7e53d21 Reviewed-by: Christian Stromme --- src/gsttools/qgstappsrc.cpp | 39 +++++++++++++--------- src/multimedia/gsttools_headers/qgstappsrc_p.h | 2 -- .../audiodecoder/qgstreameraudiodecodersession.cpp | 8 ++--- .../mediaplayer/qgstreamerplayersession.cpp | 19 ++++++++--- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/gsttools/qgstappsrc.cpp b/src/gsttools/qgstappsrc.cpp index 66c384992..c2b2faeb1 100644 --- a/src/gsttools/qgstappsrc.cpp +++ b/src/gsttools/qgstappsrc.cpp @@ -41,7 +41,6 @@ QGstAppSrc::QGstAppSrc(QObject *parent) ,m_appSrc(0) ,m_sequential(false) ,m_maxBytes(0) - ,m_setup(false) ,m_dataRequestSize(~0) ,m_dataRequested(false) ,m_enoughData(false) @@ -60,11 +59,13 @@ QGstAppSrc::~QGstAppSrc() bool QGstAppSrc::setup(GstElement* appsrc) { - if (m_setup || m_stream == 0 || appsrc == 0) - return false; - - if (m_appSrc) + if (m_appSrc) { gst_object_unref(G_OBJECT(m_appSrc)); + m_appSrc = 0; + } + + if (!appsrc || !m_stream) + return false; m_appSrc = GST_APP_SRC(appsrc); gst_object_ref(G_OBJECT(m_appSrc)); @@ -79,32 +80,35 @@ bool QGstAppSrc::setup(GstElement* appsrc) gst_app_src_set_stream_type(m_appSrc, m_streamType); gst_app_src_set_size(m_appSrc, (m_sequential) ? -1 : m_stream->size()); - return m_setup = true; + return true; } void QGstAppSrc::setStream(QIODevice *stream) { - if (stream == 0) - return; if (m_stream) { disconnect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); disconnect(m_stream, SIGNAL(destroyed()), this, SLOT(streamDestroyed())); + m_stream = 0; } - if (m_appSrc) + + if (m_appSrc) { gst_object_unref(G_OBJECT(m_appSrc)); + m_appSrc = 0; + } m_dataRequestSize = ~0; m_dataRequested = false; m_enoughData = false; m_forceData = false; + m_sequential = false; m_maxBytes = 0; - m_appSrc = 0; - m_stream = stream; - connect(m_stream, SIGNAL(destroyed()), SLOT(streamDestroyed())); - connect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); - m_sequential = m_stream->isSequential(); - m_setup = false; + if (stream) { + m_stream = stream; + connect(m_stream, SIGNAL(destroyed()), SLOT(streamDestroyed())); + connect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); + m_sequential = m_stream->isSequential(); + } } QIODevice *QGstAppSrc::stream() const @@ -135,7 +139,7 @@ void QGstAppSrc::streamDestroyed() void QGstAppSrc::pushDataToAppSrc() { - if (!isStreamValid() || !m_setup) + if (!isStreamValid() || !m_appSrc) return; if (m_dataRequested && !m_enoughData) { @@ -242,6 +246,9 @@ void QGstAppSrc::destroy_notify(gpointer data) void QGstAppSrc::sendEOS() { + if (!m_appSrc) + return; + gst_app_src_end_of_stream(GST_APP_SRC(m_appSrc)); if (isStreamValid() && !stream()->isSequential()) stream()->reset(); diff --git a/src/multimedia/gsttools_headers/qgstappsrc_p.h b/src/multimedia/gsttools_headers/qgstappsrc_p.h index ec54af0d1..c5f94ea32 100644 --- a/src/multimedia/gsttools_headers/qgstappsrc_p.h +++ b/src/multimedia/gsttools_headers/qgstappsrc_p.h @@ -54,7 +54,6 @@ public: ~QGstAppSrc(); bool setup(GstElement *); - bool isReady() const { return m_setup; } void setStream(QIODevice *); QIODevice *stream() const; @@ -93,7 +92,6 @@ private: GstAppStreamType m_streamType; GstAppSrcCallbacks m_callbacks; qint64 m_maxBytes; - bool m_setup; unsigned int m_dataRequestSize; bool m_dataRequested; bool m_enoughData; diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp index efa8dcb47..3360583c4 100644 --- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp +++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp @@ -142,9 +142,6 @@ void QGstreamerAudioDecoderSession::configureAppSrcElement(GObject* object, GObj if (!self->appsrc()) return; - if (self->appsrc()->isReady()) - return; - GstElement *appsrc; g_object_get(orig, "source", &appsrc, NULL); @@ -350,9 +347,8 @@ void QGstreamerAudioDecoderSession::start() return; } - if (m_appSrc) - m_appSrc->deleteLater(); - m_appSrc = new QGstAppSrc(this); + if (!m_appSrc) + m_appSrc = new QGstAppSrc(this); m_appSrc->setStream(mDevice); g_object_set(G_OBJECT(m_playbin), "uri", "appsrc://", NULL); diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index c3d20e790..a1eee0166 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -241,6 +241,10 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) g_signal_connect(G_OBJECT(m_playbin), "video-changed", G_CALLBACK(handleStreamsChange), this); g_signal_connect(G_OBJECT(m_playbin), "audio-changed", G_CALLBACK(handleStreamsChange), this); g_signal_connect(G_OBJECT(m_playbin), "text-changed", G_CALLBACK(handleStreamsChange), this); + +#if defined(HAVE_GST_APPSRC) + g_signal_connect(G_OBJECT(m_playbin), "deep-notify::source", G_CALLBACK(configureAppSrcElement), this); +#endif } } @@ -274,7 +278,7 @@ void QGstreamerPlayerSession::configureAppSrcElement(GObject* object, GObject *o Q_UNUSED(object); Q_UNUSED(pspec); - if (self->appsrc()->isReady()) + if (!self->appsrc()) return; GstElement *appsrc; @@ -298,16 +302,14 @@ void QGstreamerPlayerSession::loadFromStream(const QNetworkRequest &request, QIO m_lastPosition = 0; m_isPlaylist = false; - if (m_appSrc) - m_appSrc->deleteLater(); - m_appSrc = new QGstAppSrc(this); + if (!m_appSrc) + m_appSrc = new QGstAppSrc(this); m_appSrc->setStream(appSrcStream); if (m_playbin) { m_tags.clear(); emit tagsChanged(); - g_signal_connect(G_OBJECT(m_playbin), "deep-notify::source", (GCallback) &QGstreamerPlayerSession::configureAppSrcElement, (gpointer)this); g_object_set(G_OBJECT(m_playbin), "uri", "appsrc://", NULL); if (!m_streamTypes.isEmpty()) { @@ -330,6 +332,13 @@ void QGstreamerPlayerSession::loadFromUri(const QNetworkRequest &request) m_lastPosition = 0; m_isPlaylist = false; +#if defined(HAVE_GST_APPSRC) + if (m_appSrc) { + m_appSrc->deleteLater(); + m_appSrc = 0; + } +#endif + if (m_playbin) { m_tags.clear(); emit tagsChanged(); -- cgit v1.2.3 From f97c4aaa86a8a0a5694e0e534892e7a3aa76d2ca Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 19 Jan 2016 13:35:33 +0100 Subject: WindowsAudio: fix QAudioOutput state after resume(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In push mode, the state must be IdleState after resume(), and only change to ActiveState once it receives some data. Task-number: QTBUG-50390 Change-Id: I0e12f4eaff350b9423e44779f229e0e1061cf576 Reviewed-by: Pasi Petäjäjärvi --- src/plugins/windowsaudio/qwindowsaudiooutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp index 7e2205dea..22746a63a 100644 --- a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp @@ -434,7 +434,7 @@ qint64 QWindowsAudioOutput::write( const char *data, qint64 len ) void QWindowsAudioOutput::resume() { if(deviceState == QAudio::SuspendedState) { - deviceState = QAudio::ActiveState; + deviceState = pullMode ? QAudio::ActiveState : QAudio::IdleState; errorState = QAudio::NoError; waveOutRestart(hWaveOut); QTimer::singleShot(10, this, SLOT(feedback())); -- cgit v1.2.3 From 94c846fb48baec9f1a6ddcc974d6db61c95658d8 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 19 Jan 2016 13:58:06 +0100 Subject: CoreAudio: fix QAudioOutput state after resume(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In push mode, the state must be IdleState after resume(), and only change to ActiveState once it receives some data. Task-number: QTBUG-50390 Change-Id: I4a38aa84a55e90d7a2db3e1d504674b2a688bbde Reviewed-by: Pasi Petäjäjärvi --- src/plugins/coreaudio/coreaudiooutput.h | 1 + src/plugins/coreaudio/coreaudiooutput.mm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreaudio/coreaudiooutput.h b/src/plugins/coreaudio/coreaudiooutput.h index 4b4b781f5..cc391f783 100644 --- a/src/plugins/coreaudio/coreaudiooutput.h +++ b/src/plugins/coreaudio/coreaudiooutput.h @@ -187,6 +187,7 @@ private: QTimer *m_intervalTimer; CoreAudioDeviceInfo *m_audioDeviceInfo; qreal m_cachedVolume; + bool m_pullMode; QAudio::Error m_errorCode; QAudio::State m_stateCode; diff --git a/src/plugins/coreaudio/coreaudiooutput.mm b/src/plugins/coreaudio/coreaudiooutput.mm index 149b5a8c0..2db26297a 100644 --- a/src/plugins/coreaudio/coreaudiooutput.mm +++ b/src/plugins/coreaudio/coreaudiooutput.mm @@ -222,6 +222,7 @@ CoreAudioOutput::CoreAudioOutput(const QByteArray &device) , m_startTime(0) , m_audioBuffer(0) , m_cachedVolume(1.0) + , m_pullMode(false) , m_errorCode(QAudio::NoError) , m_stateCode(QAudio::StoppedState) { @@ -271,6 +272,7 @@ void CoreAudioOutput::start(QIODevice *device) m_stateCode = QAudio::ActiveState; // Start + m_pullMode = true; m_errorCode = QAudio::NoError; m_totalFrames = 0; m_startTime = CoreAudioUtils::currentTime(); @@ -296,6 +298,7 @@ QIODevice *CoreAudioOutput::start() m_stateCode = QAudio::IdleState; // Start + m_pullMode = false; m_errorCode = QAudio::NoError; m_totalFrames = 0; m_startTime = CoreAudioUtils::currentTime(); @@ -347,7 +350,7 @@ void CoreAudioOutput::resume() if (m_stateCode == QAudio::SuspendedState) { audioThreadStart(); - m_stateCode = QAudio::ActiveState; + m_stateCode = m_pullMode ? QAudio::ActiveState : QAudio::IdleState; m_errorCode = QAudio::NoError; emit stateChanged(m_stateCode); } -- cgit v1.2.3 From 627e488d548878ddfcddc2689c74dbf0fa52518b Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 19 Jan 2016 14:08:55 +0100 Subject: PulseAudio: fix QAudioOutput state after resume(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In push mode, the state must be IdleState after resume(), and only change to ActiveState once it receives some data. Change-Id: I8caff011f517e91629abf45af51580f24136bcea Task-number: QTBUG-50390 Reviewed-by: Pasi Petäjäjärvi --- src/plugins/pulseaudio/qaudiooutput_pulse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp index 533cd674c..a654af86c 100644 --- a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp @@ -555,7 +555,7 @@ void QPulseAudioOutput::resume() m_tickTimer->start(m_periodTime); - setState(QAudio::ActiveState); + setState(m_pullMode ? QAudio::ActiveState : QAudio::IdleState); setError(QAudio::NoError); } } -- cgit v1.2.3 From 4fd2b2f6849cda72cdcc06aa0907bc565875f6dd Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 19 Jan 2016 14:12:19 +0100 Subject: Alsa: fix QAudioOutput state after resume(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In push mode, the state must be IdleState after resume(), and only change to ActiveState once it receives some data. Task-number: QTBUG-50390 Change-Id: Idd08d8826f00d943b3bf750524f811874e010149 Reviewed-by: Pasi Petäjäjärvi --- src/plugins/alsa/qalsaaudiooutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/alsa/qalsaaudiooutput.cpp b/src/plugins/alsa/qalsaaudiooutput.cpp index f8f0f58e8..a382b666a 100644 --- a/src/plugins/alsa/qalsaaudiooutput.cpp +++ b/src/plugins/alsa/qalsaaudiooutput.cpp @@ -651,7 +651,7 @@ void QAlsaAudioOutput::resume() } resuming = true; - deviceState = QAudio::ActiveState; + deviceState = pullMode ? QAudio::ActiveState : QAudio::IdleState; errorState = QAudio::NoError; timer->start(period_time/1000); -- cgit v1.2.3 From e126dbb6fb7440882b49fb2fcbde53f4b0a5e180 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 19 Jan 2016 14:15:40 +0100 Subject: OpenSL ES: fix QAudioOutput state after resume(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In push mode, the state must be IdleState after resume(), and only change to ActiveState once it receives some data. Task-number: QTBUG-50390 Change-Id: Iaf47363196ee94b80ac4ebe58a588929af8d3fad Reviewed-by: Pasi Petäjäjärvi --- src/plugins/opensles/qopenslesaudiooutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index d17363d20..b12908c39 100644 --- a/src/plugins/opensles/qopenslesaudiooutput.cpp +++ b/src/plugins/opensles/qopenslesaudiooutput.cpp @@ -238,7 +238,7 @@ void QOpenSLESAudioOutput::resume() return; } - setState(QAudio::ActiveState); + setState(m_pullMode ? QAudio::ActiveState : QAudio::IdleState); setError(QAudio::NoError); } -- cgit v1.2.3 From 42dc97388137b753fbe7dc77371a51dfbd98d127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Mon, 11 Jan 2016 13:52:50 +0200 Subject: Fix tst_QAudioOutput::pushSuspendResume(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documentation states that state in push mode after suspend and resume should be QAudio::IdleState. Task-number: QTBUG-50390 Change-Id: I214f1808948ce862b62afd0fb9d245d0c7e4ad26 Reviewed-by: Pasi Petäjäjärvi --- tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp index 07043e9ce..b887d3f9a 100755 --- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp @@ -825,10 +825,10 @@ void tst_QAudioOutput::pushSuspendResume() // but not too much or the rest of the file may be processed QTest::qWait(20); - // Check that QAudioOutput immediately transitions to ActiveState + // Check that QAudioOutput immediately transitions to IdleState QVERIFY2((stateSignal.count() == 1), QString("didn't emit signal after resume(), got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData()); - QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after resume()"); + QVERIFY2((audioOutput.state() == QAudio::IdleState), "didn't transition to IdleState after resume()"); QVERIFY2((audioOutput.error() == QAudio::NoError), "error state is not equal to QAudio::NoError after resume()"); stateSignal.clear(); @@ -837,6 +837,7 @@ void tst_QAudioOutput::pushSuspendResume() if (audioOutput.bytesFree() >= audioOutput.periodSize()) { qint64 len = audioFile->read(buffer.data(),audioOutput.periodSize()); written += feed->write(buffer.constData(), len); + QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after writing audio data"); } else QTest::qWait(20); } -- cgit v1.2.3