Commit 7d3ddd33 authored by Clément Stenac's avatar Clément Stenac

Remove SAP node on quit

parent 3bb2997f
...@@ -342,6 +342,8 @@ static void Close( vlc_object_t *p_this ) ...@@ -342,6 +342,8 @@ static void Close( vlc_object_t *p_this )
{ {
services_discovery_t *p_sd = ( services_discovery_t* )p_this; services_discovery_t *p_sd = ( services_discovery_t* )p_this;
services_discovery_sys_t *p_sys = p_sd->p_sys; services_discovery_sys_t *p_sys = p_sd->p_sys;
playlist_t *p_playlist;
int i; int i;
for( i = p_sys->i_fd-1 ; i >= 0 ; i-- ) for( i = p_sys->i_fd-1 ; i >= 0 ; i-- )
...@@ -359,6 +361,15 @@ static void Close( vlc_object_t *p_this ) ...@@ -359,6 +361,15 @@ static void Close( vlc_object_t *p_this )
RemoveAnnounce( p_sd, p_sys->pp_announces[i] ); 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 ); free( p_sys );
} }
...@@ -473,13 +484,18 @@ static int Demux( demux_t *p_demux ) ...@@ -473,13 +484,18 @@ static int Demux( demux_t *p_demux )
playlist_t *p_playlist; playlist_t *p_playlist;
if( !psz_sdp )
{
return -1;
}
/* Gather the complete sdp file */ /* Gather the complete sdp file */
for( ;; ) 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, int i_read = stream_Read( p_demux->s,
&psz_sdp[i_sdp], i_max_sdp - i_sdp - 1 ); &psz_sdp[i_sdp], i_max_sdp - i_sdp - 1 );
if( i_read < 0 ) if( i_read < 0 )
{ {
......
...@@ -317,6 +317,7 @@ int playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root, ...@@ -317,6 +317,7 @@ int playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root,
else if( b_delete_items ) else if( b_delete_items )
{ {
/* Delete the item here */ /* Delete the item here */
playlist_Delete( p_playlist, p_root->pp_children[i]->input.i_id );
} }
} }
return VLC_SUCCESS; return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment