playlist: set "input-current" to NULL when appropriate
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 16 Aug 2014 12:31:25 +0000 (15:31 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 16 Aug 2014 12:48:57 +0000 (15:48 +0300)
src/playlist/thread.c

index ea96549..8e7b082 100644 (file)
@@ -223,10 +223,10 @@ static void PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
             vlc_object_release( p_input_thread );
             p_input_thread = NULL;
         }
             vlc_object_release( p_input_thread );
             p_input_thread = NULL;
         }
-        else
-            var_SetAddress( p_playlist, "input-current", p_input_thread );
     }
 
     }
 
+    var_SetAddress( p_playlist, "input-current", p_input_thread );
+
     /* TODO store art policy in playlist private data */
     char *psz_arturl = input_item_GetArtURL( p_input );
     /* p_input->p_meta should not be null after a successful CreateThread */
     /* TODO store art policy in playlist private data */
     char *psz_arturl = input_item_GetArtURL( p_input );
     /* p_input->p_meta should not be null after a successful CreateThread */
@@ -446,6 +446,8 @@ static void LoopInput( playlist_t *p_playlist )
         PL_DEBUG( "dead input" );
         PL_UNLOCK;
 
         PL_DEBUG( "dead input" );
         PL_UNLOCK;
 
+        var_SetAddress( p_playlist, "input-current", NULL );
+
         /* WARNING: Input resource manipulation and callback deletion are
          * incompatible with the playlist lock. */
         if( !var_InheritBool( p_input, "sout-keep" ) )
         /* WARNING: Input resource manipulation and callback deletion are
          * incompatible with the playlist lock. */
         if( !var_InheritBool( p_input, "sout-keep" ) )