]> git.sesse.net Git - vlc/commitdiff
Remove SAP node on quit
authorClément Stenac <zorglub@videolan.org>
Wed, 17 Nov 2004 22:11:26 +0000 (22:11 +0000)
committerClément Stenac <zorglub@videolan.org>
Wed, 17 Nov 2004 22:11:26 +0000 (22:11 +0000)
modules/services_discovery/sap.c
src/playlist/view.c

index 9e6710e6908a698d1158e2fa1383c7974d5b03a9..b773acfa347191790621c6af72ba51ffe7753fd6 100644 (file)
@@ -342,6 +342,8 @@ static void Close( vlc_object_t *p_this )
 {
     services_discovery_t *p_sd = ( services_discovery_t* )p_this;
     services_discovery_sys_t    *p_sys  = p_sd->p_sys;
+
+    playlist_t *p_playlist;
     int i;
 
     for( i = p_sys->i_fd-1 ; i >= 0 ; i-- )
@@ -359,6 +361,15 @@ static void Close( vlc_object_t *p_this )
         RemoveAnnounce( p_sd, p_sys->pp_announces[i] );
     }
 
+    p_playlist = (playlist_t *) vlc_object_find( p_sd, VLC_OBJECT_PLAYLIST,
+                                                 FIND_ANYWHERE );
+
+    if( p_playlist )
+    {
+        playlist_NodeDelete( p_playlist, p_sys->p_node, VLC_TRUE );
+        vlc_object_release( p_playlist );
+    }
+
     free( p_sys );
 }
 
@@ -473,13 +484,18 @@ static int Demux( demux_t *p_demux )
 
    playlist_t *p_playlist;
 
+   if( !psz_sdp )
+   {
+        return -1;
+   }
+
    /* Gather the complete sdp file */
    for( ;; )
    {
+        fprintf(stderr,"read %i at %p\n",i_max_sdp - i_sdp - 1, &psz_sdp[i_sdp]);
         int i_read = stream_Read( p_demux->s,
                                   &psz_sdp[i_sdp], i_max_sdp - i_sdp - 1 );
 
-
         if( i_read < 0 )
 
         {
index ef73a9bf12a8b3ee15484cf36681d0635b13d793..50729e5eb60a7d9665ea0b2b41879b858f3885d2 100644 (file)
@@ -317,6 +317,7 @@ int playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root,
         else if( b_delete_items )
         {
             /* Delete the item here */
+            playlist_Delete( p_playlist, p_root->pp_children[i]->input.i_id );
         }
     }
     return VLC_SUCCESS;