Commit c205ecf9 authored by Christophe Mutricy's avatar Christophe Mutricy

Compile fix after d228fdd2

parent d626fdc4
......@@ -168,7 +168,7 @@ DBUS_METHOD( PositionGet )
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;
......@@ -207,7 +207,7 @@ DBUS_METHOD( PositionSet )
}
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 )
{
......@@ -320,7 +320,7 @@ DBUS_METHOD( Play )
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;
......@@ -344,8 +344,9 @@ DBUS_METHOD( GetCurrentMetadata )
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;
......@@ -804,7 +805,7 @@ static void Close ( vlc_object_t *p_this )
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 );
......@@ -997,7 +998,7 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var,
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 )
{
......@@ -1041,13 +1042,14 @@ static int UpdateCaps( intf_thread_t* p_intf, bool b_playlist_locked )
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;
}
......@@ -1166,7 +1168,7 @@ static int MarshalStatus( intf_thread_t* p_intf, DBusMessageIter* args,
i_state = 2;
p_input = p_playlist->p_input;
p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
var_Get( p_input, "state", &val );
......
......@@ -144,7 +144,8 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
char *psz_artist = NULL;
char *psz_album = NULL;
char *psz_arturl = NULL;
input_thread_t *p_input = ((playlist_t*) p_this)->p_input;
input_thread_t *p_input = playlist_CurrentInput(
(playlist_t*) p_this );
intf_thread_t *p_intf = ( intf_thread_t* ) param;
intf_sys_t *p_sys = p_intf->p_sys;
......
......@@ -137,12 +137,13 @@ static void Close( vlc_object_t *p_this )
{
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 );
......@@ -190,7 +191,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
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 );
......
......@@ -234,19 +234,20 @@ static void Run( intf_thread_t *p_intf )
}
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 );
......
......@@ -1930,7 +1930,7 @@ static int StateCallback( vlc_object_t *p_this, char const *psz_cmd,
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 );
......@@ -1948,7 +1948,7 @@ static void AddStateVariableCallback(filter_t *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 );
......
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