summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/mediaplayer
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-03-03 18:39:43 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 15:34:09 +0100
commit70415c3d9752e357e8d49633cdd8e82d3519e59b (patch)
tree2b562cb5a2939bff14dbe99c1e929efaf5c34e2c /src/plugins/avfoundation/mediaplayer
parent1fe5a7964fa1362349b10753c5cc89f1cc7fd978 (diff)
AVFoundation: Call stop() on VideoSurface when changing sources
Before we were reusing the active surface when we switched videos. This leads to an inconsitency in states, and the sourceRect property of the video surface does not get updated. Task-number: QTBUG-28655 Change-Id: Ie29bf1d9b1c11b6f51a869253c730202001c07cf Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/plugins/avfoundation/mediaplayer')
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm b/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
index 7fa7172e2..c7087b612 100644
--- a/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfvideorenderercontrol.mm
@@ -182,6 +182,11 @@ void AVFVideoRendererControl::setLayer(void *playerLayer)
m_playerLayer = playerLayer;
+ //If there is an active surface, make sure it has been stopped so that
+ //we can update it's state with the new content.
+ if (m_surface && m_surface->isActive())
+ m_surface->stop();
+
//If there is no layer to render, stop scheduling updates
if (m_playerLayer == 0) {
m_displayLink->stop();