Commit 2c595f38 authored by Antoine Cellerier's avatar Antoine Cellerier

Move intf-popupmenu and video-on-top variables from playlist to libvlc.

Should fix assertion errors.
parent 6d6c549c
...@@ -211,9 +211,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -211,9 +211,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf ); var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Register callback for the intf-popupmenu variable */ /* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf ); var_AddCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
pl_Release( p_intf );
/* VideoWidget connect mess to avoid different threads speaking to each other */ /* VideoWidget connect mess to avoid different threads speaking to each other */
CONNECT( this, askReleaseVideo( void * ), CONNECT( this, askReleaseVideo( void * ),
...@@ -282,9 +280,7 @@ MainInterface::~MainInterface() ...@@ -282,9 +280,7 @@ MainInterface::~MainInterface()
var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf ); var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Unregister callback for the intf-popupmenu variable */ /* Unregister callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf ); var_DelCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
pl_Release( p_intf );
p_intf->b_interaction = false; p_intf->b_interaction = false;
var_DelCallback( p_intf, "interaction", InteractCallback, this ); var_DelCallback( p_intf, "interaction", InteractCallback, this );
......
...@@ -49,12 +49,7 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface ) ...@@ -49,12 +49,7 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf ); var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Register callback for the intf-popupmenu variable */ /* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf ); var_AddCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
if( p_playlist != NULL )
{
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
pl_Release( p_playlist );
}
Start( 100 /*milliseconds*/, wxTIMER_CONTINUOUS ); Start( 100 /*milliseconds*/, wxTIMER_CONTINUOUS );
} }
...@@ -64,12 +59,7 @@ Timer::~Timer() ...@@ -64,12 +59,7 @@ Timer::~Timer()
var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf ); var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Unregister callback */ /* Unregister callback */
playlist_t *p_playlist = pl_Yield( p_intf ); var_DelCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
if( p_playlist != NULL )
{
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
pl_Release( p_playlist );
}
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -77,15 +77,9 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ); ...@@ -77,15 +77,9 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args );
static void DirectXPopupMenu( event_thread_t *p_event, bool b_open ) static void DirectXPopupMenu( event_thread_t *p_event, bool b_open )
{ {
playlist_t *p_playlist = vlc_object_find( p_event, vlc_value_t val;
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); val.b_bool = b_open;
if( p_playlist ) var_Set( p_event->p_libvlc, "intf-popupmenu", val );
{
vlc_value_t val;
val.b_bool = b_open;
var_Set( p_playlist, "intf-popupmenu", val );
vlc_object_release( p_playlist );
}
} }
static int DirectXConvertKey( int i_key ); static int DirectXConvertKey( int i_key );
......
...@@ -433,6 +433,7 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -433,6 +433,7 @@ static int Manage( vout_thread_t *p_vout )
case SDL_BUTTON_LEFT: case SDL_BUTTON_LEFT:
{ {
playlist_t *p_playlist; playlist_t *p_playlist;
vlc_value_t val;
var_Get( p_vout, "mouse-button-down", &val ); var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~1; val.i_int &= ~1;
...@@ -441,15 +442,8 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -441,15 +442,8 @@ static int Manage( vout_thread_t *p_vout )
val.b_bool = true; val.b_bool = true;
var_Set( p_vout, "mouse-clicked", val ); var_Set( p_vout, "mouse-clicked", val );
p_playlist = pl_Yield( p_vout ); val.b_bool = false;
var_Set( p_vout->p_libvlc, "intf-popupmenu", val );
if( p_playlist != NULL )
{
vlc_value_t val;
val.b_bool = false;
var_Set( p_playlist, "intf-popupmenu", val );
pl_Release( p_playlist );
}
} }
break; break;
...@@ -484,15 +478,8 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -484,15 +478,8 @@ static int Manage( vout_thread_t *p_vout )
vlc_object_release( p_intf ); vlc_object_release( p_intf );
} }
p_playlist = pl_Yield( p_vout ); val.b_bool = true;
var_Set( p_vout->p_libvlc, "intf-popupmenu", val );
if( p_playlist != NULL )
{
vlc_value_t val;
val.b_bool = true;
var_Set( p_playlist, "intf-popupmenu", val );
pl_Release( p_playlist );
}
} }
break; break;
} }
...@@ -531,12 +518,16 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -531,12 +518,16 @@ static int Manage( vout_thread_t *p_vout )
/* Quit event (close the window) */ /* Quit event (close the window) */
case SDL_QUIT: case SDL_QUIT:
{ {
#if 0
playlist_t *p_playlist = pl_Yield( p_vout ); playlist_t *p_playlist = pl_Yield( p_vout );
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
pl_Release( p_playlist ); pl_Release( p_playlist );
} }
#else
#warning FIXME FIXME ?
#endif
} }
break; break;
......
...@@ -1300,13 +1300,8 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -1300,13 +1300,8 @@ static int ManageVideo( vout_thread_t *p_vout )
val.b_bool = true; val.b_bool = true;
var_Set( p_vout, "mouse-clicked", val ); var_Set( p_vout, "mouse-clicked", val );
p_playlist = pl_Yield( p_vout ); vlc_value_t val; val.b_bool = false;
if( p_playlist != NULL ) var_Set( p_vout->p_libvlc, "intf-popupmenu", val );
{
vlc_value_t val; val.b_bool = false;
var_Set( p_playlist, "intf-popupmenu", val );
pl_Release( p_playlist );
}
} }
break; break;
...@@ -1338,13 +1333,8 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -1338,13 +1333,8 @@ static int ManageVideo( vout_thread_t *p_vout )
vlc_object_release( p_intf ); vlc_object_release( p_intf );
} }
p_playlist = pl_Yield( p_vout ); vlc_value_t val; val.b_bool = true;
if( p_playlist != NULL ) var_Set( p_vout->p_libvlc, "intf-popupmenu", val );
{
vlc_value_t val; val.b_bool = true;
var_Set( p_playlist, "intf-popupmenu", val );
pl_Release( p_playlist );
}
} }
break; break;
...@@ -1474,12 +1464,16 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -1474,12 +1464,16 @@ static int ManageVideo( vout_thread_t *p_vout )
== p_vout->p_sys->p_win->wm_delete_window ) ) == p_vout->p_sys->p_win->wm_delete_window ) )
{ {
/* the user wants to close the window */ /* the user wants to close the window */
#if 0
playlist_t * p_playlist = pl_Yield( p_vout ); playlist_t * p_playlist = pl_Yield( p_vout );
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
pl_Release( p_playlist ); pl_Release( p_playlist );
} }
#else
#warning FIXME FIXME FIXME
#endif
} }
} }
......
...@@ -899,8 +899,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -899,8 +899,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
var_Create( p_libvlc, "volume-change", VLC_VAR_BOOL ); var_Create( p_libvlc, "volume-change", VLC_VAR_BOOL );
/* Create a variable for showing the interface (moved from playlist). */ /* Create a variable for showing the interface (moved from playlist). */
var_Create( p_playlist, "intf-show", VLC_VAR_BOOL ); var_Create( p_libvlc, "intf-show", VLC_VAR_BOOL );
var_SetBool( p_playlist, "intf-show", true ); var_SetBool( p_libvlc, "intf-show", true );
var_Create( p_libvlc, "intf-popupmenu", VLC_VAR_BOOL );
/* /*
* Get input filenames given as commandline arguments * Get input filenames given as commandline arguments
......
...@@ -693,8 +693,6 @@ static void VariablesInit( playlist_t *p_playlist ) ...@@ -693,8 +693,6 @@ static void VariablesInit( playlist_t *p_playlist )
val.i_int = -1; val.i_int = -1;
var_Set( p_playlist, "playlist-current", val ); var_Set( p_playlist, "playlist-current", val );
var_Create( p_playlist, "intf-popupmenu", VLC_VAR_BOOL );
var_Create( p_playlist, "activity", VLC_VAR_INTEGER ); var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "activity", 0 ); var_SetInteger( p_playlist, "activity", 0 );
......
...@@ -1135,15 +1135,13 @@ static int OnTopCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1135,15 +1135,13 @@ static int OnTopCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
playlist_t *p_playlist = pl_Yield( p_this );
vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, newval.b_bool ); vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, newval.b_bool );
(void)psz_cmd; (void)oldval; (void)p_data; (void)psz_cmd; (void)oldval; (void)p_data;
/* Modify playlist as well because the vout might have to be restarted */ /* Modify libvlc as well because the vout might have to be restarted */
var_Create( p_playlist, "video-on-top", VLC_VAR_BOOL ); var_Create( p_vout->p_libvlc, "video-on-top", VLC_VAR_BOOL );
var_Set( p_playlist, "video-on-top", newval ); var_Set( p_vout->p_libvlc, "video-on-top", newval );
pl_Release( p_this );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -1152,15 +1150,13 @@ static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1152,15 +1150,13 @@ static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd,
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
vlc_value_t val; vlc_value_t val;
playlist_t *p_playlist = pl_Yield( p_this );
(void)psz_cmd; (void)oldval; (void)p_data; (void)psz_cmd; (void)oldval; (void)p_data;
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE; p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
/* Modify playlist as well because the vout might have to be restarted */ /* Modify libvlc as well because the vout might have to be restarted */
var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL ); var_Create( p_vout->p_libvlc, "fullscreen", VLC_VAR_BOOL );
var_Set( p_playlist, "fullscreen", newval ); var_Set( p_vout->p_libvlc, "fullscreen", newval );
pl_Release( p_playlist );
val.b_bool = true; val.b_bool = true;
var_Set( p_vout, "intf-change", val ); var_Set( p_vout, "intf-change", val );
......
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