summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-12-15 08:57:18 +0100
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2017-12-20 12:52:57 +0000
commit48e0fc2ca67a4adbc4f051413ea3febdb24a6822 (patch)
treee50c3b915c453025c90ee52a1a7173d92ce33568 /src
parent9caee039533168fbb546b563859770414e54fc94 (diff)
Fix precision loss in QDeclarativeVideoRendererBackend::adjustedViewport
Applied casting to keep precision. Task-number: QTBUG-64044 Change-Id: If3cb29b5c049302de38e5417811792405c896334 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index f1b7662b..0cb6659c 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -382,9 +382,9 @@ QAbstractVideoSurface *QDeclarativeVideoRendererBackend::videoSurface() const
QRectF QDeclarativeVideoRendererBackend::adjustedViewport() const
{
const QRectF viewport = m_surface->surfaceFormat().viewport();
- const QSize pixelAspectRatio = m_surface->surfaceFormat().pixelAspectRatio();
+ const QSizeF pixelAspectRatio = m_surface->surfaceFormat().pixelAspectRatio();
- if (pixelAspectRatio.height() != 0) {
+ if (pixelAspectRatio.isValid()) {
const qreal ratio = pixelAspectRatio.width() / pixelAspectRatio.height();
QRectF result = viewport;
result.setX(result.x() * ratio);