summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@qt.io>2017-04-06 17:18:14 +0200
committerChristian Stromme <christian.stromme@qt.io>2017-04-20 19:37:57 +0000
commite3b7957d6552e88aa23bd0ecc474db5f14981707 (patch)
treeb3341389ca3bde38f98d1b7a1cafbaa2a66af542
parent021e8989308fba30425e7a0f34f4e176a8aa3ccf (diff)
Fix time-stamp tests in tst_qmediaplayerbackend
Not all backends supports or have an implementation that sets the time-stamp on the video frames, so check if we do have valid time-stamps before running any tests that depends on it. Change-Id: I53926022a02cd87d23c493f7b392c4eb4c45a55e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r--tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
index e60ea2cd7..7366ea200 100644
--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -749,6 +749,10 @@ void tst_QMediaPlayerBackend::seekPauseSeek()
QTRY_COMPARE(player.state(), QMediaPlayer::PausedState); // it might take some time for the operation to be completed
QTRY_VERIFY(!surface->m_frameList.isEmpty()); // we must see a frame at position 7000 here
+ // Make sure that the frame has a timestamp before testing - not all backends provides this
+ if (surface->m_frameList.back().startTime() < 0)
+ QSKIP("No timestamp");
+
{
QVideoFrame frame = surface->m_frameList.back();
const qint64 elapsed = (frame.startTime() / 1000) - position; // frame.startTime() is microsecond, position is milliseconds.