Commit 84a5171f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: make "activity" a void variable and simplify

parent ac124a0d
...@@ -426,8 +426,7 @@ static void VariablesInit( playlist_t *p_playlist ) ...@@ -426,8 +426,7 @@ static void VariablesInit( playlist_t *p_playlist )
var_Create( p_playlist, "item-current", VLC_VAR_ADDRESS ); var_Create( p_playlist, "item-current", VLC_VAR_ADDRESS );
var_Create( p_playlist, "input-current", VLC_VAR_ADDRESS ); var_Create( p_playlist, "input-current", VLC_VAR_ADDRESS );
var_Create( p_playlist, "activity", VLC_VAR_INTEGER ); var_Create( p_playlist, "activity", VLC_VAR_VOID );
var_SetInteger( p_playlist, "activity", 0 );
/* Variables to control playback */ /* Variables to control playback */
var_Create( p_playlist, "playlist-autostart", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_playlist, "playlist-autostart", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
......
...@@ -128,14 +128,6 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd, ...@@ -128,14 +128,6 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static void UpdateActivity( playlist_t *p_playlist, int i_delta )
{
PL_ASSERT_LOCKED;
const int i_activity = var_GetInteger( p_playlist, "activity" ) ;
var_SetInteger( p_playlist, "activity", i_activity + i_delta );
}
/** /**
* Synchronise the current index of the playlist * Synchronise the current index of the playlist
* to match the index of the current item. * to match the index of the current item.
...@@ -233,7 +225,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item ) ...@@ -233,7 +225,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
p_sys->status.i_status = PLAYLIST_RUNNING; p_sys->status.i_status = PLAYLIST_RUNNING;
UpdateActivity( p_playlist, DEFAULT_INPUT_ACTIVITY ); var_TriggerCallback( p_playlist, "activity" );
assert( p_sys->p_input == NULL ); assert( p_sys->p_input == NULL );
...@@ -485,7 +477,7 @@ static int LoopInput( playlist_t *p_playlist ) ...@@ -485,7 +477,7 @@ static int LoopInput( playlist_t *p_playlist )
p_sys->p_input = NULL; p_sys->p_input = NULL;
input_Close( p_input ); input_Close( p_input );
UpdateActivity( p_playlist, -DEFAULT_INPUT_ACTIVITY ); var_TriggerCallback( p_playlist, "activity" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
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