diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-08-29 09:55:11 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-09-04 09:00:54 +0200 |
commit | f5a115a2a49d8eb92b45997879be05b5c8f259f0 (patch) | |
tree | 76774190fe9b266ee8a52ecd09209fdf0346b215 /src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | |
parent | 03188b88025a849e15125eecb21395fa7f9a0158 (diff) |
Fix crash when VideoOutput.sourceRect is requested but playback is stopped
When the playback is stopped, QAbstractVideoSurface::stop is called
where current surface format is reset.
And when sourceRect is requested before QAbstractVideoSurface::surfaceFormatChanged()
is handled, it produces an ASSERT.
Suggesting to use cached surfaceFormat instead of removing the ASSERT.
To reproduce:
MediaPlayer {
onStatusChanged: console.log(output.sourceRect)
}
Change-Id: I73ad72f1e4968fe45266827ec5c7e3b36333ee30
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp')
-rw-r--r-- | src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp index 5cb4689cc..40568d118 100644 --- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp +++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp @@ -390,8 +390,8 @@ QAbstractVideoSurface *QDeclarativeVideoRendererBackend::videoSurface() const QRectF QDeclarativeVideoRendererBackend::adjustedViewport() const { - const QRectF viewport = m_surface->surfaceFormat().viewport(); - const QSizeF pixelAspectRatio = m_surface->surfaceFormat().pixelAspectRatio(); + const QRectF viewport = m_surfaceFormat.viewport(); + const QSizeF pixelAspectRatio = m_surfaceFormat.pixelAspectRatio(); if (pixelAspectRatio.isValid()) { const qreal ratio = pixelAspectRatio.width() / pixelAspectRatio.height(); |