Commit e3b7957d authored by Christian Strømme's avatar Christian Strømme Committed by Christian Stromme
Browse files

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: default avatarEirik Aavitsland <eirik.aavitsland@qt.io>
parent 021e8989
Branches
Tags
No related merge requests found
Showing with 4 additions and 0 deletions
...@@ -749,6 +749,10 @@ void tst_QMediaPlayerBackend::seekPauseSeek() ...@@ -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_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 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(); QVideoFrame frame = surface->m_frameList.back();
const qint64 elapsed = (frame.startTime() / 1000) - position; // frame.startTime() is microsecond, position is milliseconds. const qint64 elapsed = (frame.startTime() / 1000) - position; // frame.startTime() is microsecond, position is milliseconds.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment