diff options
author | André de la Rocha <andre.rocha@qt.io> | 2022-03-16 22:00:33 -0300 |
---|---|---|
committer | André de la Rocha <andre.rocha@qt.io> | 2022-03-17 09:35:13 -0300 |
commit | 8be9b6d21402d6dcc5ae881ed2421e2d7d37d201 (patch) | |
tree | 971af3ce996aaede543ab3f5a59dc4d49e2ecb01 | |
parent | d5d9ee5e32dee63a6f4dd8d666177877284ff7e4 (diff) | |
download | qtmultimedia-8be9b6d21402d6dcc5ae881ed2421e2d7d37d201.tar.gz |
Windows: Avoid WMF error with some specific video files
Some specific video files cause a WMF error when played, possibly due to
an issue in WMF, likely triggered by a non-standard setting in the
files. However, the video files play fine when the error is ignored,
which seems to cause no other issues.
Fixes: QTBUG-100835
Change-Id: I7227c0bfbe3c1504e57ce3aec1c92c433879e618
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 6ed6d0ab838c8e9a808105376c5a92747f1a252c)
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
-rw-r--r-- | src/multimedia/platform/windows/player/mfplayersession.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/multimedia/platform/windows/player/mfplayersession.cpp b/src/multimedia/platform/windows/player/mfplayersession.cpp index f859f2535..ccaa081f9 100644 --- a/src/multimedia/platform/windows/player/mfplayersession.cpp +++ b/src/multimedia/platform/windows/player/mfplayersession.cpp @@ -1639,6 +1639,14 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent) changeStatus(QMediaPlayer::InvalidMedia); break; case MEError: + if (hrStatus == MF_E_ALREADY_INITIALIZED) { + // Workaround for a possible WMF issue that causes an error + // with some specific videos, which play fine otherwise. +#ifdef DEBUG_MEDIAFOUNDATION + qDebug() << "handleSessionEvent: ignoring MF_E_ALREADY_INITIALIZED"; +#endif + break; + } changeStatus(QMediaPlayer::InvalidMedia); qWarning() << "handleSessionEvent: serious error = " << hrStatus; emit error(QMediaPlayer::ResourceError, tr("Media session serious error."), true); |