]> git.sesse.net Git - vlc/commitdiff
input: SoutKeep() needs to pay attention to the cases where the playlist doesn't...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 31 Mar 2008 11:42:50 +0000 (13:42 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 31 Mar 2008 11:42:50 +0000 (13:42 +0200)
Signed-off-by: Rafaël Carré <funman@videolan.org>
src/input/input.c

index befb73a0b67c9c0a5a3e27b7e724a9b50b99de52..6f1554f29a4f2ae7b32e1b4591d34de3d907e50d 100644 (file)
@@ -1381,7 +1381,8 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
     if( b_keep_sout )
     {
         /* Remove the sout from the playlist garbage collector */
-        /* FIXME: we don't want to depend on the playlist */
+        /* FIXME: we don't want to depend on the playlist, sout
+         * should be attached to libvlc */
         playlist_t * p_playlist = vlc_object_find( p_parent,
             VLC_OBJECT_PLAYLIST, FIND_PARENT );
         if( p_playlist )
@@ -1413,10 +1414,14 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
 
     return p_sout;
 }
+
 static void SoutKeep( sout_instance_t *p_sout )
 {
-    /* attach sout to the playlist */
-    playlist_t  *p_playlist = pl_Yield( p_sout );
+    /* FIXME: we don't want to depend on the playlist, sout
+     * should be attached to libvlc */
+    playlist_t * p_playlist = vlc_object_find( p_sout, VLC_OBJECT_PLAYLIST,
+                                               FIND_PARENT );
+    if( !p_playlist ) return;
 
     msg_Dbg( p_sout, "sout has been kept" );
     vlc_object_attach( p_sout, p_playlist );