summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Sutterud <lars.sutterud@qt.io>2023-11-30 12:51:17 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-12-22 17:15:50 +0000
commitc36e6fec8e177761a62b850ba368a35ce68d95fd (patch)
treec97c79c287169676ea24a1a21eabf750dbc642b4 /src
parent7bdb2d0e6dbd71fd0b27ffbe613b763641192fec (diff)
QFFmpegMediaPlayer: Fix stop() not resetting position if EndOfMedia
If QFFmpegMediaPlayer::stop() was called after playing a media file all the way to the end, the playback position of the would not be reset. In that scenario, a subsequent call to play() would just reset the position to 0 instead of starting playback from the beginning as expected. Solution: - Call m_playbackEngine->seek(0) in stop() - Write new test that covers the above scenario Fixes: QTBUG-118127 Pick-to: 6.6 6.5 Change-Id: Ibcb313721099c3e53fd6b1b1d52aad712a0c8eb0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> (cherry picked from commit ad783bb7099fbbc98cf1a27ea8a5910604fc7596) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/multimedia/ffmpeg/qffmpegmediaplayer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpegmediaplayer.cpp b/src/plugins/multimedia/ffmpeg/qffmpegmediaplayer.cpp
index 335312199..fe8e83a97 100644
--- a/src/plugins/multimedia/ffmpeg/qffmpegmediaplayer.cpp
+++ b/src/plugins/multimedia/ffmpeg/qffmpegmediaplayer.cpp
@@ -314,6 +314,7 @@ void QFFmpegMediaPlayer::stop()
m_playbackEngine->stop();
m_positionUpdateTimer.stop();
+ m_playbackEngine->seek(0);
positionChanged(0);
stateChanged(QMediaPlayer::StoppedState);
mediaStatusChanged(QMediaPlayer::LoadedMedia);