playlist_t *p_playlist = pl_Hold( ((vlc_object_t*) p_this) );
PL_LOCK;
- input_thread_t *p_input = p_playlist->p_input;
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if( !p_input )
i_pos = 0;
}
p_playlist = pl_Hold( ((vlc_object_t*) p_this) );
PL_LOCK;
- input_thread_t *p_input = p_playlist->p_input;
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
playlist_t *p_playlist = pl_Hold( (vlc_object_t*) p_this );
PL_LOCK;
- input_thread_t *p_input = p_playlist->p_input;
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if( p_input )
vlc_object_hold( p_input );
PL_UNLOCK;
OUT_ARGUMENTS;
playlist_t* p_playlist = pl_Hold( (vlc_object_t*) p_this );
PL_LOCK;
- if( p_playlist->status.p_item )
- GetInputMeta( p_playlist->status.p_item->p_input, &args );
+ playlist_item_t* p_item = playlist_CurrentPlayingItem( p_playlist );
+ if( p_item )
+ GetInputMeta( p_item->p_input, &args );
PL_UNLOCK;
pl_Release( (vlc_object_t*) p_this );
REPLY_SEND;
var_DelCallback( p_playlist, "repeat", StatusChangeEmit, p_intf );
var_DelCallback( p_playlist, "loop", StatusChangeEmit, p_intf );
- p_input = p_playlist->p_input;
+ p_input = playlist_CurrentInput( p_playlist );
if ( p_input )
{
vlc_object_hold( p_input );
p_sys->b_meta_read = false;
p_playlist = pl_Hold( p_intf );
- p_input = p_playlist->p_input;
+ p_input = playlist_CurrentInput( p_playlist );
if( !p_input )
{
if( p_playlist->current.i_size > 0 )
i_caps |= CAPS_CAN_PLAY | CAPS_CAN_GO_PREV | CAPS_CAN_GO_NEXT;
-
- if( p_playlist->p_input )
+
+ input_thread_t* p_input = playlist_CurrentInput( p_playlist );
+ if( p_input )
{
/* XXX: if UpdateCaps() is called too early, these are
* unconditionnaly true */
- if( var_GetBool( p_playlist->p_input, "can-pause" ) )
+ if( var_GetBool( p_input, "can-pause" ) )
i_caps |= CAPS_CAN_PAUSE;
- if( var_GetBool( p_playlist->p_input, "seekable" ) )
+ if( var_GetBool( p_input, "seekable" ) )
i_caps |= CAPS_CAN_SEEK;
}
i_state = 2;
- p_input = p_playlist->p_input;
+ p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
var_Get( p_input, "state", &val );
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
playlist_t *p_playlist = pl_Hold( p_this );
+ input_thread_t *p_input = NULL;
PL_LOCK;
var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
- if( p_playlist->p_input )
- var_DelCallback( p_playlist->p_input, "state", StateChange, p_intf );
+ if( (p_input = playlist_CurrentInput( p_playlist )) )
+ var_DelCallback( p_input, "state", StateChange, p_intf );
PL_UNLOCK;
pl_Release( p_this );
p_intf->p_sys->i_item_changes++;
}
- p_input = p_playlist->p_input;
+ p_input = playlist_CurrentInput( p_playlist );
if( !p_input ) return VLC_SUCCESS;
vlc_object_hold( p_input );
}
free( psz_display );
psz_display = NULL;
- if( p_playlist->status.i_status == PLAYLIST_STOPPED )
+ int i_status = playlist_Status( p_playlist );
+ if( i_status == PLAYLIST_STOPPED )
{
psz_display = strdup(_("Stop"));
pl_Release( p_intf );
}
- else if( p_playlist->status.i_status == PLAYLIST_PAUSED )
+ else if( i_status == PLAYLIST_PAUSED )
{
psz_display = strdup(_("Pause"));
pl_Release( p_intf );
}
else
{
- p_item = p_playlist->status.p_item;
+ p_item = playlist_CurrentPlayingItem( p_playlist );
p_input = p_item->p_input;
pl_Release( p_intf );
static void AddStateVariableCallback(filter_t *p_filter)
{
playlist_t *p_playlist = pl_Hold( p_filter );
- input_thread_t *p_input = p_playlist->p_input;
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if(p_input)
{
var_AddCallback( p_input, "state", StateCallback, p_filter );
static void DelStateVariableCallback( filter_t *p_filter )
{
playlist_t *p_playlist = pl_Hold( p_filter );
- input_thread_t *p_input = p_playlist->p_input;
+ input_thread_t *p_input = playlist_CurrentInput( p_playlist );
if(p_input)
{
var_DelCallback( p_input, "state", StateCallback, p_filter );