diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-11-29 11:52:51 +0100 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-11-29 12:36:10 +0000 |
commit | a9889e9e853b2b0e9b3736a258c908fa7559b35c (patch) | |
tree | f4ed423c5369d9097c7c086a54d10924ea22963e | |
parent | 67a826716a9a58659f7272cbce3c450af384da5a (diff) | |
download | qtmultimedia-a9889e9e853b2b0e9b3736a258c908fa7559b35c.tar.gz |
DirectShow: Restart not active surface when frame is received
If playback is not stopped but EndOfMedia is received, it would be still possible to
seek to previous position and start playback again which will cause empty
video output because the surface has been already stopped and should be
restarted.
Task-number: QTBUG-42057
Change-Id: I5ca496ba3af5c27c0ad61edb35d758e201061595
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/plugins/common/evr/evrcustompresenter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp index 5ebde2dda..872b97bcc 100644 --- a/src/plugins/common/evr/evrcustompresenter.cpp +++ b/src/plugins/common/evr/evrcustompresenter.cpp @@ -1925,12 +1925,12 @@ void EVRCustomPresenter::presentSample(IMFSample *sample) return; } - if (!m_surface || !m_surface->isActive() || !m_presentEngine->videoSurfaceFormat().isValid()) + if (!m_surface || !m_presentEngine->videoSurfaceFormat().isValid()) return; QVideoFrame frame = m_presentEngine->makeVideoFrame(sample); - if (m_surface->isActive() && m_surface->surfaceFormat() != m_presentEngine->videoSurfaceFormat()) { + if (!m_surface->isActive() || m_surface->surfaceFormat() != m_presentEngine->videoSurfaceFormat()) { m_surface->stop(); if (!m_surface->start(m_presentEngine->videoSurfaceFormat())) return; |