diff options
author | André de la Rocha <andre.rocha@qt.io> | 2022-02-27 03:59:01 +0100 |
---|---|---|
committer | André de la Rocha <andre.rocha@qt.io> | 2022-03-01 00:23:46 +0100 |
commit | 5244909f912da4b9e1cfe7df76cd7f889e1f3d2e (patch) | |
tree | dad61b77f016befa045442339fba981109d69041 | |
parent | 45cc591e99dff18a838035a7857495b95c881b32 (diff) |
Windows: Fix lack of precision in positioning while playing flac
When changing the position while playing a flac file, the actually played
position is not the one specified precisely; it seems to snap to some
low precision point. However, the precise position is being specified
correctly at the WMF level, and flac files not being handled differently
in any way. This behavior seems to be caused by an issue in WMF. However,
it seems that resetting the audio output routing when playing the file for
the first time avoids the issue without causing side effects.
Fixes: QTBUG-100181
Change-Id: Ifbf7770df0040231dc1b75edd9b2b34d6c870ef0
Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit aeff72e2b875b69a2d4d4d1e186da33130d4d94d)
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
-rw-r--r-- | src/multimedia/platform/windows/player/mfplayercontrol.cpp | 2 | ||||
-rw-r--r-- | src/multimedia/platform/windows/player/mfplayersession_p.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/multimedia/platform/windows/player/mfplayercontrol.cpp b/src/multimedia/platform/windows/player/mfplayercontrol.cpp index 67a5caa7b..eb2c84f4e 100644 --- a/src/multimedia/platform/windows/player/mfplayercontrol.cpp +++ b/src/multimedia/platform/windows/player/mfplayercontrol.cpp @@ -96,6 +96,8 @@ void MFPlayerControl::play() case QMediaPlayer::BufferedMedia: case QMediaPlayer::EndOfMedia: changeState(QMediaPlayer::PlayingState); + if (m_session->status() == QMediaPlayer::LoadedMedia) + m_session->updateOutputRouting(); m_session->start(); break; default: //Loading/Stalled diff --git a/src/multimedia/platform/windows/player/mfplayersession_p.h b/src/multimedia/platform/windows/player/mfplayersession_p.h index e88e787a3..a8456f641 100644 --- a/src/multimedia/platform/windows/player/mfplayersession_p.h +++ b/src/multimedia/platform/windows/player/mfplayersession_p.h @@ -148,6 +148,7 @@ public: public Q_SLOTS: void setVolume(float volume); void setMuted(bool muted); + void updateOutputRouting(); Q_SIGNALS: void sessionEvent(IMFMediaEvent *sessionEvent); @@ -156,7 +157,6 @@ private Q_SLOTS: void handleMediaSourceReady(); void handleSessionEvent(IMFMediaEvent *sessionEvent); void handleSourceError(long hr); - void updateOutputRouting(); void timeout(); private: |