rc: add missing playlist_Lock()/playlist_Unlock() for playlist_Status().
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Thu, 19 Feb 2009 15:14:36 +0000 (16:14 +0100)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Fri, 20 Feb 2009 16:10:56 +0000 (17:10 +0100)
modules/control/rc.c

index 389a2f2..29a9f1e 100644 (file)
@@ -990,8 +990,9 @@ static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,
     p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
     if( p_input )
     {
-        p_playlist = pl_Hold( p_input );
         char cmd[6];
+        p_playlist = pl_Hold( p_input );
+        playlist_Lock( p_playlist );
         switch( playlist_Status( p_playlist ) )
         {
         case PLAYLIST_STOPPED:
@@ -1006,6 +1007,7 @@ static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,
         default:
             cmd[0] = '\0';
         } /* var_GetInteger( p_input, "state" )  */
+        playlist_Unlock( p_playlist );
         msg_rc( STATUS_CHANGE "( %s state: %d ): %s",
                               cmd, newval.i_int,
                               ppsz_input_state[ newval.i_int ] );