diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-10-07 11:57:30 +0200 |
---|---|---|
committer | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-10-08 10:07:25 +0200 |
commit | 5f6f82baeacce06dc4bdcaa307eff1772e89cd3e (patch) | |
tree | de8cec153abcf02094c3718a63894b56aab6a5b6 /src | |
parent | 0a6f22dbbc3f36b82190b1dc52ecee082c8b90bc (diff) | |
download | qtmultimedia-5f6f82baeacce06dc4bdcaa307eff1772e89cd3e.tar.gz |
DirectShow: Fix crash when media in qrc is set twice
When qrc media content is set, it allocates and opens QFile.
If the same content is set again, the url remains the same,
but it creats new QFile, and need to update DirectShowIOReader by new
stream.
Change-Id: If3f5c187c4e2987e1a593b45f9a46c3c1b77ce45
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/directshow/player/directshowplayercontrol.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/directshow/player/directshowplayercontrol.cpp b/src/plugins/directshow/player/directshowplayercontrol.cpp index 87bd53bc4..8fddc2102 100644 --- a/src/plugins/directshow/player/directshowplayercontrol.cpp +++ b/src/plugins/directshow/player/directshowplayercontrol.cpp @@ -51,6 +51,7 @@ DirectShowPlayerControl::DirectShowPlayerControl(DirectShowPlayerService *servic : QMediaPlayerControl(parent) , m_service(service) , m_audio(0) + , m_stream(0) , m_updateProperties(0) , m_state(QMediaPlayer::StoppedState) , m_status(QMediaPlayer::NoMedia) @@ -221,7 +222,7 @@ const QIODevice *DirectShowPlayerControl::mediaStream() const void DirectShowPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream) { - if (m_media == media) + if (m_media == media && m_stream == stream) return; m_pendingPosition = -1; |