[vlc-commits] playlist: make "activity" a void variable and simplify

Rémi Denis-Courmont git at videolan.org
Mon Nov 26 18:37:42 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 26 19:36:16 2012 +0200| [84a5171fa314607b3047b3dcd7eb3f1aa5935024] | committer: Rémi Denis-Courmont

playlist: make "activity" a void variable and simplify

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=84a5171fa314607b3047b3dcd7eb3f1aa5935024
---

 src/playlist/engine.c |    3 +--
 src/playlist/thread.c |   12 ++----------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 63c22f1..aca7b59 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -426,8 +426,7 @@ static void VariablesInit( playlist_t *p_playlist )
     var_Create( p_playlist, "item-current", VLC_VAR_ADDRESS );
     var_Create( p_playlist, "input-current", VLC_VAR_ADDRESS );
 
-    var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
-    var_SetInteger( p_playlist, "activity", 0 );
+    var_Create( p_playlist, "activity", VLC_VAR_VOID );
 
     /* Variables to control playback */
     var_Create( p_playlist, "playlist-autostart", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 07a6b71..e9d53d4 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -128,14 +128,6 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
     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
  * to match the index of the current item.
@@ -233,7 +225,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
 
     p_sys->status.i_status = PLAYLIST_RUNNING;
 
-    UpdateActivity( p_playlist, DEFAULT_INPUT_ACTIVITY );
+    var_TriggerCallback( p_playlist, "activity" );
 
     assert( p_sys->p_input == NULL );
 
@@ -485,7 +477,7 @@ static int LoopInput( playlist_t *p_playlist )
         p_sys->p_input = NULL;
         input_Close( p_input );
 
-        UpdateActivity( p_playlist, -DEFAULT_INPUT_ACTIVITY );
+        var_TriggerCallback( p_playlist, "activity" );
 
         return VLC_EGENERIC;
     }



More information about the vlc-commits mailing list