summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-07-27 19:02:18 +0200
committerLars Knoll <lars.knoll@qt.io>2021-07-30 09:21:53 +0200
commit0de7ff081f6d75122d2186d399a6f06cd865978e (patch)
tree909dfacb19aed1754187ed572f81b0c439678503 /tests
parentf8917196e8844fe9a5efcc973ee2204f7956ada0 (diff)
Fix QMediaPlayer::isSeekable() on gstreamer
Properly determine whether seeking is allowed on the given source. Add an auto test. Fixes: QTBUG-95246 Change-Id: I6a81a4690c6f9d53ef1ef9c217a3077fa63c05d0 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
index c27e956c7..acc5138d7 100644
--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -78,6 +78,7 @@ private slots:
void playerStateAtEOS();
void playFromBuffer();
void audioVideoAvailable();
+ void isSeekable();
private:
QUrl selectVideoFile(const QStringList& mediaCandidates);
@@ -1108,6 +1109,19 @@ void tst_QMediaPlayerBackend::audioVideoAvailable()
QCOMPARE(hasAudioSpy.count(), 2);
}
+void tst_QMediaPlayerBackend::isSeekable()
+{
+ if (localVideoFile.isEmpty())
+ QSKIP("No supported video file");
+
+ TestVideoSink surface(false);
+ QMediaPlayer player;
+ player.setVideoOutput(&surface);
+ QVERIFY(!player.isSeekable());
+ player.setSource(localVideoFile);
+ QTRY_VERIFY(player.isSeekable());
+}
+
QTEST_MAIN(tst_QMediaPlayerBackend)
#include "tst_qmediaplayerbackend.moc"