Commit f0270d55 authored by Erwan Tulou's avatar Erwan Tulou

skins2: replacement for vlc_object_find_name no longer operational

parent c24b0a6f
......@@ -972,11 +972,10 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
/* In skins interface, append some items */
if( !mi )
{
vlc_object_t *p_object = ( vlc_object_t* )
vlc_object_find_name( p_intf, "skins2", FIND_PARENT );
if( p_object )
if( p_intf->p_sys->b_isDialogProvider )
{
vlc_object_t* p_object = p_intf->p_parent;
objects.clear(); varnames.clear();
objects.push_back( p_object );
varnames.push_back( "intf-skins" );
......@@ -986,8 +985,6 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
objects.push_back( p_object );
varnames.push_back( "intf-skins-interactive" );
Populate( p_intf, submenu, varnames, objects );
vlc_object_release( p_object );
}
else
msg_Warn( p_intf, "could not find parent interface" );
......
......@@ -125,6 +125,9 @@ static int Open( vlc_object_t *p_this )
// Create a variable to be notified of skins to be loaded
var_Create( p_intf, "skin-to-load", VLC_VAR_STRING );
vlc_mutex_init( &p_intf->p_sys->vout_lock );
vlc_cond_init( &p_intf->p_sys->vout_wait );
vlc_mutex_init( &p_intf->p_sys->init_lock );
vlc_cond_init( &p_intf->p_sys->init_wait );
......@@ -135,8 +138,11 @@ static int Open( vlc_object_t *p_this )
VLC_THREAD_PRIORITY_LOW ) )
{
vlc_mutex_unlock( &p_intf->p_sys->init_lock );
vlc_cond_destroy( &p_intf->p_sys->init_wait );
vlc_mutex_destroy( &p_intf->p_sys->init_lock );
vlc_cond_destroy( &p_intf->p_sys->vout_wait );
vlc_mutex_destroy( &p_intf->p_sys->vout_lock );
pl_Release( p_intf->p_sys->p_playlist );
free( p_intf->p_sys );
return VLC_EGENERIC;
......@@ -150,9 +156,6 @@ static int Open( vlc_object_t *p_this )
skin_load.intf = p_intf;
vlc_mutex_unlock( &skin_load.mutex );
vlc_mutex_init( &p_intf->p_sys->vout_lock );
vlc_cond_init( &p_intf->p_sys->vout_wait );
return VLC_SUCCESS;
}
......@@ -358,28 +361,33 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
// Callbacks for vout requests
static int WindowOpen( vlc_object_t *p_this )
{
int i_ret;
vout_window_t *pWnd = (vout_window_t *)p_this;
intf_thread_t *pIntf = (intf_thread_t *)
vlc_object_find_name( p_this, "skins2", FIND_ANYWHERE );
vlc_mutex_lock( &skin_load.mutex );
intf_thread_t *pIntf = skin_load.intf;
if( pIntf )
vlc_object_hold( pIntf );
vlc_mutex_unlock( &skin_load.mutex );
if( pIntf == NULL )
return VLC_EGENERIC;
vlc_object_release( pIntf );
vlc_mutex_lock( &serializer );
pWnd->handle.hwnd = VoutManager::getWindow( pIntf, pWnd );
if( pWnd->handle.hwnd )
{
pWnd->sys = (vout_window_sys_t*)pIntf;
pWnd->control = &VoutManager::controlWindow;
pWnd->sys = (vout_window_sys_t*)pIntf;
vlc_mutex_unlock( &serializer );
return VLC_SUCCESS;
}
else
{
vlc_object_release( pIntf );
vlc_mutex_unlock( &serializer );
return VLC_EGENERIC;
}
......@@ -391,6 +399,8 @@ static void WindowClose( vlc_object_t *p_this )
intf_thread_t *pIntf = (intf_thread_t *)pWnd->sys;
VoutManager::releaseWindow( pIntf, pWnd );
vlc_object_release( pIntf );
}
//---------------------------------------------------------------------------
......
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