summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2019-09-06 16:14:46 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2019-10-01 08:35:29 +0000
commit7aa08ffafd5ac69bca02038aae80ea014f444174 (patch)
tree77b07599e870fc15849b1326430b87787ea328af
parent9eef3390241f8c6e25c5ccc7b1baa25058146927 (diff)
downloadqtmultimedia-7aa08ffafd5ac69bca02038aae80ea014f444174.tar.gz
DirectShow: Don't seek if playback is stopped
If the playback is already stopped, and after that new position is requested twice, e.g. stop(); setPosition(0); setPosition(0); this causes the playback to start. Need to postpone setting of new position until play is requested. Also no need to emit positionChanged when position is not changed. Fixes: QTBUG-68778 Change-Id: Ib62942ee155d9c8ed2310132dcc6b501dfef1a04 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
-rw-r--r--src/plugins/directshow/player/directshowplayercontrol.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/directshow/player/directshowplayercontrol.cpp b/src/plugins/directshow/player/directshowplayercontrol.cpp
index 14f272f17..87bd53bc4 100644
--- a/src/plugins/directshow/player/directshowplayercontrol.cpp
+++ b/src/plugins/directshow/player/directshowplayercontrol.cpp
@@ -102,9 +102,11 @@ void DirectShowPlayerControl::setPosition(qint64 position)
emit mediaStatusChanged(m_status);
}
- if (m_state == QMediaPlayer::StoppedState && m_pendingPosition != position) {
- m_pendingPosition = position;
- emit positionChanged(m_pendingPosition);
+ if (m_state == QMediaPlayer::StoppedState) {
+ if (m_pendingPosition != position) {
+ m_pendingPosition = position;
+ emit positionChanged(m_pendingPosition);
+ }
return;
}