From d9dd7f4896cbc0fe1dc37e517c28315419e6ffcd Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Thu, 11 Jul 2019 14:35:47 +0200 Subject: VideoOutput: Update geometry only when the surface is active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since starting the surface could be done after updating the geometry of VideoOutput element (paint event is received), and this leads setting invalid geometry to renderer and never updates by correct one. Because the geometry is not "dirty" anymore, means already set. Need just to update geometry when (or keep trying before) the surface is already started with proper video surface format. Change-Id: I338d7fe355c20f2027c6231241714376e9b569b2 Fixes: QTBUG-76205 Reviewed-by: MÃ¥rten Nordheim --- src/qtmultimediaquicktools/qdeclarativevideooutput.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp index 3c6a6f9c5..5430063fe 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp @@ -411,8 +411,13 @@ void QDeclarativeVideoOutput::_q_updateGeometry() m_contentRect.moveCenter(rect.center()); } - if (m_backend) - m_backend->updateGeometry(); + if (m_backend) { + if (!m_backend->videoSurface() || m_backend->videoSurface()->isActive()) + m_backend->updateGeometry(); + else + m_geometryDirty = true; + } + if (m_contentRect != oldContentRect) emit contentRectChanged(); -- cgit v1.2.3