summaryrefslogtreecommitdiff
path: root/elements
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2012-01-03 19:11:17 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2012-01-06 17:55:15 +0200
commit3bce083683794f26ec67fc90f4d3a7c5f732362f (patch)
tree1f6dbc6cc98c81d43d715d77896000211e45299d /elements
parent9e865caa3fb3e6840a8b387e9919b955d1992691 (diff)
qtvideosink: Fix crash when restarting with the same buffer format.
Diffstat (limited to 'elements')
-rw-r--r--elements/gstqtvideosink/gstqtvideosinksurface.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/elements/gstqtvideosink/gstqtvideosinksurface.cpp b/elements/gstqtvideosink/gstqtvideosinksurface.cpp
index 0b686ae..b59230e 100644
--- a/elements/gstqtvideosink/gstqtvideosinksurface.cpp
+++ b/elements/gstqtvideosink/gstqtvideosinksurface.cpp
@@ -223,11 +223,12 @@ void GstQtVideoSinkSurface::paint(QPainter *painter, int x, int y, int width, in
//TODO add properties for modifying clipRect
- if (m_formatDirty) {
+ if (m_formatDirty || !m_painter) {
//if either pixelFormat or frameSize have changed, we need to reset the painter
//and/or change painter, in case the current one does not handle the requested format
if (format.pixelFormat() != m_bufferFormat.pixelFormat()
- || format.frameSize() != m_bufferFormat.frameSize())
+ || format.frameSize() != m_bufferFormat.frameSize()
+ || !m_painter)
{
changePainter(format);
}
@@ -419,8 +420,10 @@ bool GstQtVideoSinkSurface::event(QEvent *event)
m_buffer = NULL;
}
- m_painter->cleanup();
- destroyPainter();
+ if (m_painter) {
+ m_painter->cleanup();
+ destroyPainter();
+ }
g_signal_emit(m_sink, GstQtVideoSink::s_signals[GstQtVideoSink::UPDATE_SIGNAL], 0);