From: Clément Stenac Date: Sun, 6 Aug 2006 16:14:56 +0000 (+0000) Subject: Fix deletion of items when changing them to nodes X-Git-Tag: 0.9.0-test0~10678 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=29a03bfd0be5cc9834daa416496f44eaa401827b;p=vlc Fix deletion of items when changing them to nodes --- diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c index de036a7420..01233ad74f 100644 --- a/modules/demux/playlist/m3u.c +++ b/modules/demux/playlist/m3u.c @@ -55,7 +55,7 @@ int E_(Import_M3U)( vlc_object_t *p_this ) demux_t *p_demux = (demux_t *)p_this; uint8_t *p_peek; CHECK_PEEK( p_peek, 8 ); - + if( POKE( p_peek, "#EXTM3U", 7 ) || POKE( p_peek, "RTSPtext", 8 ) || isExtension( p_demux, ".m3u" ) || isExtension( p_demux, ".vlc" ) || /* A .ram file can contain a single rtsp link */ @@ -66,7 +66,7 @@ int E_(Import_M3U)( vlc_object_t *p_this ) } else return VLC_EGENERIC; - + STANDARD_DEMUX_INIT_MSG( "found valid M3U playlist" ); p_demux->p_sys->psz_prefix = E_(FindPrefix)( p_demux ); diff --git a/modules/demux/playlist/shoutcast.c b/modules/demux/playlist/shoutcast.c index d47e41312e..ca7caebbf7 100644 --- a/modules/demux/playlist/shoutcast.c +++ b/modules/demux/playlist/shoutcast.c @@ -71,7 +71,7 @@ int E_(Import_Shoutcast)( vlc_object_t *p_this ) if( !isDemux( p_demux, "shout-winamp" ) ) return VLC_EGENERIC; - + STANDARD_DEMUX_INIT_MSG( "using shoutcast playlist reader" ); p_demux->p_sys->p_playlist = NULL; p_demux->p_sys->p_xml = NULL; diff --git a/modules/services_discovery/shout.c b/modules/services_discovery/shout.c index f9167d8a2a..9038d70d04 100644 --- a/modules/services_discovery/shout.c +++ b/modules/services_discovery/shout.c @@ -154,13 +154,18 @@ static int Open( vlc_object_t *p_this, int i_type ) 0, NULL, -1 ); break; } - /* TODO FLAGS */ p_sys->p_node_cat = playlist_NodeAddInput( p_playlist, p_sys->p_input, p_playlist->p_root_category, PLAYLIST_APPEND, PLAYLIST_END ); p_sys->p_node_one = playlist_NodeAddInput( p_playlist, p_sys->p_input, p_playlist->p_root_onelevel, PLAYLIST_APPEND, PLAYLIST_END ); + p_sys->p_node_cat->i_flags |= PLAYLIST_RO_FLAG; + p_sys->p_node_cat->i_flags |= PLAYLIST_SKIP_FLAG; + p_sys->p_node_one->i_flags |= PLAYLIST_RO_FLAG; + p_sys->p_node_one->i_flags |= PLAYLIST_SKIP_FLAG; + p_sys->p_node_one->p_input->i_id = p_sys->p_node_cat->p_input->i_id; + val.b_bool = VLC_TRUE; var_Set( p_playlist, "intf-change", val ); diff --git a/src/playlist/item.c b/src/playlist/item.c index 61a61e439c..85580e5de5 100644 --- a/src/playlist/item.c +++ b/src/playlist/item.c @@ -137,14 +137,16 @@ int playlist_DeleteFromInput( playlist_t *p_playlist, int i_input_id, p_root->pp_children[i]->p_input->i_id == i_input_id ) { DeleteInner( p_playlist, p_root->pp_children[i], b_do_stop ); + return VLC_SUCCESS; } else if( p_root->pp_children[i]->i_children >= 0 ) { - return playlist_DeleteFromInput( p_playlist, i_input_id, + int i_ret = playlist_DeleteFromInput( p_playlist, i_input_id, p_root->pp_children[i], b_do_stop ); + if( i_ret == VLC_SUCCESS ) return VLC_SUCCESS; } } - return -1; + return VLC_EGENERIC; } /** Remove a playlist item from the playlist, given its id */ @@ -389,7 +391,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist, */ /* Fast track the media library, no time to loose */ - if( p_item == p_playlist->p_ml_category ) + if( p_item == p_playlist->p_ml_category ) return p_item; /** \todo First look if we don't already have it */ @@ -409,7 +411,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist, } else { - playlist_DeleteFromInput( p_playlist, p_item->p_input->i_id, + playlist_DeleteFromInput( p_playlist, p_item_in_one->p_input->i_id, p_playlist->p_root_onelevel, VLC_FALSE ); } var_SetInteger( p_playlist, "item-change", p_item->p_input->i_id ); @@ -650,9 +652,6 @@ int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item, int i_id = p_item->i_id; vlc_bool_t b_flag = VLC_FALSE; - //fprintf( stderr, "Deleting item %i - %s\n", i_id, - // p_item->p_input->psz_name ); - if( p_item->i_children > -1 ) { return playlist_NodeDelete( p_playlist, p_item, VLC_TRUE, VLC_FALSE );