]> git.sesse.net Git - vlc/commitdiff
telepathy: compute test only one time
authorRémi Duraffort <ivoire@videolan.org>
Wed, 25 Feb 2009 12:25:29 +0000 (13:25 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 25 Feb 2009 18:37:01 +0000 (19:37 +0100)
(and strlen("item-current") == 12)

modules/misc/notify/telepathy.c

index a18687eb4afbec53e3fc9b1cd04282d4975cdbdd..d3e407c46939d7046b0febc2475b5e940a16d40a 100644 (file)
@@ -173,9 +173,10 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     playlist_t* p_playlist = (playlist_t*) p_this;
     char *psz_buf = NULL;
     input_thread_t *p_input;
+    bool b_is_item_current = !strncmp( "item-current", psz_var, 12 );
 
     /* Don't update Telepathy presence each time an item has been preparsed */
-    if( !strncmp( "item-current", psz_var, 16 ) )
+    if( b_is_item_current )
     { /* stores the current input item id */
         p_intf->p_sys->i_id = newval.i_int;
         p_intf->p_sys->i_item_changes = 0;
@@ -209,7 +210,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
         }
     }
 
-    if( !strncmp( "item-current", psz_var, 16 ) )
+    if( b_is_item_current )
         var_AddCallback( p_input, "state", StateChange, p_intf );
 
     /* We format the string to be displayed */