summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré de la Rocha <andre.rocha@qt.io>2022-02-27 03:59:01 +0100
committerAndré de la Rocha <andre.rocha@qt.io>2022-03-01 00:22:47 +0100
commit91af68bdc0fca7b7b17559a02f02d9d09af7581c (patch)
treee7b0a6f1bd0b576f7f258bdead8aff3f373ef045
parent2cd91bf30b991e644b009b5fce24d390ed991daa (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.cpp2
-rw-r--r--src/multimedia/platform/windows/player/mfplayersession_p.h2
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: