Commit fe23407a authored by Olivier Teulière's avatar Olivier Teulière

* skins: Reparent the embedded vout window when switching to the wx intf

parent 98d5f291
......@@ -101,7 +101,7 @@ bool ThemeLoader::load( const string &fileName )
if( skin_last ) free( skin_last );
// The new theme cannot embed a video output yet
getIntf()->p_sys->p_vlcProc->setVoutUnused();
VlcProc::instance( getIntf() )->dropVout();
return true;
}
......
......@@ -163,6 +163,17 @@ void VlcProc::setVoutWindow( void *pVoutWindow )
}
void VlcProc::dropVout()
{
if( m_pVout )
{
if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
vout_Control( m_pVout, VOUT_CLOSE );
m_pVout = NULL;
}
}
void VlcProc::manage()
{
// Did the user requested to quit vlc ?
......
......@@ -68,9 +68,9 @@ class VlcProc: public SkinObject
/// Indicate whether the embedded video output is currently used
bool isVoutUsed() const { return m_pVout; }
/// Forget that an embedded video output is used (typically used when
/// changing skins, since the video output cannot change parent)
void setVoutUnused() { m_pVout = NULL; }
/// If an embedded video output is used, drop it (i.e. tell it to stop
/// using our window handle)
void dropVout();
protected:
// Protected because it is a singleton
......
......@@ -43,7 +43,15 @@ VoutWindow::~VoutWindow()
{
delete m_pImage;
}
// XXX we should stop the vout before destroying the window!
// Get the VlcProc
VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
// Reparent the video output
if( pVlcProc && pVlcProc->isVoutUsed() )
{
pVlcProc->dropVout();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment