summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2019-10-07 11:57:30 +0200
committerVal Doroshchuk <valentyn.doroshchuk@qt.io>2019-10-08 10:07:25 +0200
commit5f6f82baeacce06dc4bdcaa307eff1772e89cd3e (patch)
treede8cec153abcf02094c3718a63894b56aab6a5b6 /src
parent0a6f22dbbc3f36b82190b1dc52ecee082c8b90bc (diff)
downloadqtmultimedia-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.cpp3
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;