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:
committed by
The Qt Project
parent
3d4980312f
commit
9ea9d57bbf
@@ -86,7 +86,11 @@ public:
|
|||||||
|
|
||||||
void setVideoSurface(QAbstractVideoSurface *surface)
|
void setVideoSurface(QAbstractVideoSurface *surface)
|
||||||
{
|
{
|
||||||
|
if (m_surface != surface && m_surface && m_surface->isActive()) {
|
||||||
|
m_surface->stop();
|
||||||
|
}
|
||||||
m_surface = surface;
|
m_surface = surface;
|
||||||
|
if (m_surface)
|
||||||
m_surface->start(m_format);
|
m_surface->start(m_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user