Commit 29a03bfd authored by Clément Stenac's avatar Clément Stenac

Fix deletion of items when changing them to nodes

parent 6bdb92a0
......@@ -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 );
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 );
......
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