Doc: Fix faulty snippet in Video Overview page

This change modifies setVideoSurface() in the snippet code
to be a bit more robust.

Task-number: QTBUG-29383

Change-Id: I2c691f19fe8f0912c1287597045da3a5579d2108
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
Topi Reinio
2013-02-05 09:51:42 +01:00
committed by The Qt Project
parent 3d4980312f
commit 9ea9d57bbf

View File

@@ -86,7 +86,11 @@ public:
void setVideoSurface(QAbstractVideoSurface *surface)
{
if (m_surface != surface && m_surface && m_surface->isActive()) {
m_surface->stop();
}
m_surface = surface;
if (m_surface)
m_surface->start(m_format);
}