WMF: release video controls before releasing the session

For the VideoRendererControl, also stop the video surface at the same
time.
This fixes a crash when changing video.

Change-Id: I49484f8b277c345dafb3e5947cf5d23df15546f3
Reviewed-by: Jason Barron <jason@cutehacks.com>
This commit is contained in:
Yoann Lopes
2012-12-18 22:16:13 +01:00
committed by The Qt Project
parent 6eb192f047
commit 60eb27dfef
5 changed files with 24 additions and 3 deletions

View File

@@ -1781,6 +1781,7 @@ namespace
, m_sink(0)
, m_rendererControl(rendererControl)
, m_attributes(0)
, m_surface(0)
{
MFCreateAttributes(&m_attributes, 0);
m_sink = new MediaSink(rendererControl);
@@ -2143,6 +2144,9 @@ MFVideoRendererControl::~MFVideoRendererControl()
void MFVideoRendererControl::clear()
{
if (m_surface)
m_surface->stop();
if (m_currentActivate) {
m_currentActivate->ShutdownObject();
m_currentActivate->Release();
@@ -2150,6 +2154,11 @@ void MFVideoRendererControl::clear()
m_currentActivate = NULL;
}
void MFVideoRendererControl::releaseActivate()
{
clear();
}
QAbstractVideoSurface *MFVideoRendererControl::surface() const
{
return m_surface;
@@ -2209,10 +2218,8 @@ IMFActivate* MFVideoRendererControl::createActivate()
clear();
m_currentActivate = new VideoRendererActivate(this);
if (m_surface) {
if (m_surface)
setSurface(m_surface);
supportedFormatsChanged();
}
return m_currentActivate;
}