]> git.sesse.net Git - vlc/blobdiff - src/playlist/engine.c
codec: dts: fix custom channel mapping detection/tautology
[vlc] / src / playlist / engine.c
index 990bcb1b63c622249fa1733f10c34e4523e89ea1..05ea3b11745ae36104250c64d71b05070f237217 100644 (file)
@@ -84,18 +84,19 @@ static int CorksCallback( vlc_object_t *obj, char const *var,
     if( !old.i_int == !cur.i_int )
         return VLC_SUCCESS; /* nothing to do */
 
+    if( !var_InheritBool( obj, "playlist-cork" ) )
+        return VLC_SUCCESS;
+
     if( cur.i_int )
     {
-        if( var_InheritBool( obj, "playlist-cork" ) )
-        {
-            msg_Dbg( obj, "corked" );
-            playlist_Pause( pl );
-        }
-        else
-            msg_Dbg( obj, "not corked" );
+        msg_Dbg( obj, "corked" );
+        playlist_Pause( pl );
     }
     else
+    {
         msg_Dbg( obj, "uncorked" );
+        playlist_Resume( pl );
+    }
 
     (void) var; (void) dummy;
     return VLC_SUCCESS;
@@ -244,7 +245,7 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
         ml = NULL;
     PL_UNLOCK;
 
-    if( unlikely(root == NULL || playing == NULL || ml == NULL) )
+    if( unlikely(root == NULL || playing == NULL) )
         abort();
 
     p_playlist->p_root = root;
@@ -261,7 +262,6 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
     pl_priv(p_playlist)->status.p_item = NULL;
     pl_priv(p_playlist)->status.p_node = p_playlist->p_playing;
     pl_priv(p_playlist)->request.b_request = false;
-    pl_priv(p_playlist)->status.i_status = PLAYLIST_STOPPED;
 
     if (ml != NULL)
         playlist_MLLoad( p_playlist );
@@ -496,8 +496,14 @@ playlist_item_t * playlist_CurrentPlayingItem( playlist_t * p_playlist )
 
 int playlist_Status( playlist_t * p_playlist )
 {
+    input_thread_t *p_input = pl_priv(p_playlist)->p_input;
+
     PL_ASSERT_LOCKED;
 
-    return pl_priv(p_playlist)->status.i_status;
+    if( p_input == NULL )
+        return PLAYLIST_STOPPED;
+    if( var_GetInteger( p_input, "state" ) == PAUSE_S )
+        return PLAYLIST_PAUSED;
+    return PLAYLIST_RUNNING;
 }