]> git.sesse.net Git - vlc/commitdiff
Do not check that playlist has an input twice
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 11 Aug 2009 15:40:25 +0000 (18:40 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 11 Aug 2009 15:40:25 +0000 (18:40 +0300)
(This does NOT fix the RC pause deadlock)

src/playlist/control.c

index 4aed8889a5f90ca2f4cf4374e73a0cb462eab6c0..1f10fb71d7dee518cb2638bd95c1d862c4decc81 100644 (file)
@@ -151,22 +151,21 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
         break;
 
     case PLAYLIST_PAUSE:
-        if( pl_priv(p_playlist)->p_input &&
-            var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S )
+        if( !pl_priv(p_playlist)->p_input )
+        {    /* FIXME: is this really useful without input? */
+             pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED;
+             break;
+        }
+
+        if( var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S )
         {
             pl_priv(p_playlist)->status.i_status = PLAYLIST_RUNNING;
-            if( pl_priv(p_playlist)->p_input )
-            {
-                var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S );
-            }
+            var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S );
         }
         else
         {
             pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED;
-            if( pl_priv(p_playlist)->p_input )
-            {
-                var_SetInteger( pl_priv(p_playlist)->p_input, "state", PAUSE_S );
-            }
+            var_SetInteger( pl_priv(p_playlist)->p_input, "state", PAUSE_S );
         }
         break;