CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
input_item_SetDuration( p_current, i_duration );
+ input_item_node_t *p_root = input_item_node_Create( p_current );
+
/* Build title table */
for( int i = 0; i < i_titles; i++ )
{
input_item_SetTrackNum( p_input_item, psz_num );
input_item_AddSubItem( p_current, p_input_item );
+ input_item_node_AppendItem( p_root, p_input_item );
vlc_gc_decref( p_input_item );
free( psz_uri ); free( psz_opt ); free( psz_name );
free( psz_first ); free( psz_last );
#undef ON_EMPTY
#undef NONEMPTY
+ input_item_AddSubItemTree( p_root );
+ input_item_node_Delete( p_root );
+
/* */
for( int i = 0; i < i_cd_text; i++ )
{
}
/** \bug we do not autodelete here */
p_new_loc = input_item_New( p_access, psz_location, psz_location );
- input_item_AddSubItem( input_GetItem( p_input ), p_new_loc );
+ input_item_t *p_item = input_GetItem( p_input );
+ input_item_AddSubItem( p_item, p_new_loc );
+ input_item_AddSubItem2( p_item, p_new_loc );
+
vlc_gc_decref( p_new_loc );
vlc_object_release( p_input );
input_thread_t *p_input = demux_GetParentInput( p_demux );
input_item_t *p_current = input_GetItem( p_input );
+ input_item_node_t *p_subitems = input_item_node_Create( p_current );
+
for( i = 0; i < i_count; i++ )
{
MP4_Box_t *p_rdrf = MP4_BoxGet( p_rmra, "rmda[%d]/rdrf", i );
input_item_t *p_input = input_item_New( p_demux, psz_ref, NULL );
input_item_CopyOptions( p_current, p_input );
input_item_AddSubItem( p_current, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
else
}
free( psz_ref );
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
vlc_object_release( p_input );
}
if( p_sys->i_data_len <= 0 ) return -1;
}
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
psz_parse = p_sys->psz_data;
/* Find first element */
if( ( psz_parse = strcasestr( psz_parse, "<ASX" ) ) )
p_input = input_item_New( p_demux, psz_string, psz_title_asx );
input_item_CopyOptions( p_current_input, p_input );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
free( psz_string );
}
vlc_gc_decref( uniq_entry_ad_backup );
}
input_item_AddSubItem( p_current_input, p_entry );
+ input_item_node_AppendItem( p_subitems, p_entry );
vlc_gc_decref( p_entry );
}
}
if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
input_item_AddSubItem( p_current_input, p_entry );
+ input_item_node_AppendItem( p_subitems, p_entry );
vlc_gc_decref( p_entry );
}
msg_Dbg( p_demux, "added unique entry even if ad");
/* If ASX contains a unique entry, we add it, it is probably not an ad */
input_item_AddSubItem( p_current_input, uniq_entry_ad_backup );
+ input_item_node_AppendItem( p_subitems, uniq_entry_ad_backup );
vlc_gc_decref( uniq_entry_ad_backup);
}
#if 0
STARTMARK
#endif
}
+
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+
vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
input_item_t *p_input;
char *psz_mrl = NULL, *psz_title = NULL, *psz_genre = NULL;
char *psz_now = NULL, *psz_listeners = NULL, *psz_bitrate = NULL;
+ input_item_node_t *p_subitems = NULL;
input_item_t *p_current_input = GetCurrentItem(p_demux);
free( psz_value );
}
+ p_subitems = input_item_node_Create( p_current_input );
+
while( (i_ret = xml_ReaderRead( p_xml_reader )) == 1 )
{
// Get the node type
msg_Err( p_demux, "Unsupported meta bitrate" );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
FREENULL( psz_title );
FREENULL( psz_mrl );
end:
free( psz_elname );
+ if( p_subitems )
+ {
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+ }
+
vlc_gc_decref( p_current_input );
if( p_xml_reader )
xml_ReaderDelete( p_xml, p_xml_reader );
input_item_t *p_input;
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
while( (psz_line = stream_ReadLine( p_demux->s )) )
{
char **ppsz_options = NULL;
p_input = input_item_NewExt( p_demux, "dvb://", psz_name,
i_options, (const char**)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
while( i_options-- )
free( psz_line );
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+
vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
p_sys->p_current_input = p_current_input;
while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
SADD_INFO( "docid", psz_docid );
SADD_INFO( "description", psz_description );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+
vlc_gc_decref(p_current_input);
free( psz_version );
input_item_t *p_current_input = GetCurrentItem(p_demux);
input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_AddSubItem2( p_current_input, p_input );
vlc_gc_decref( p_input );
vlc_gc_decref(p_current_input);
input_item_t *p_current_input = GetCurrentItem(p_demux);
input_item_t *p_input = input_item_New( p_demux, psz_url, psz_url );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_AddSubItem2( p_current_input, p_input );
+
vlc_gc_decref( p_input );
vlc_gc_decref(p_current_input);
input_item_t *p_input;
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
psz_line = stream_ReadLine( p_demux->s );
while( psz_line )
if( psz_name ) input_item_SetTitle( p_input, psz_name );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
b_cleanup = false;
}
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
{
if( !strncasecmp( psz_line, "[playlist]", sizeof("[playlist]")-1 ) ||
p_input = input_item_New( p_demux, psz_mrl, psz_name );
input_item_CopyOptions( p_current_input, p_input );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
else
p_input = input_item_New( p_demux, psz_mrl, psz_name );
input_item_CopyOptions( p_current_input, p_input );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
free( psz_mrl_orig );
psz_mrl = NULL;
free( psz_name );
psz_name = NULL;
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+
vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
char *psz_art_url = NULL;
int i_type;
input_item_t *p_input;
+ input_item_node_t *p_subitems = NULL;
input_item_t *p_current_input = GetCurrentItem(p_demux);
}
FREENULL( psz_elname );
+ p_subitems = input_item_node_Create( p_current_input );
+
while( (i_ret = xml_ReaderRead( p_xml_reader )) == 1 )
{
// Get the node type
psz_item_size );
}
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
FREENULL( psz_item_name );
FREENULL( psz_item_mrl );
xml_ReaderDelete( p_xml, p_xml_reader );
xml_Delete( p_xml );
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
xml_ReaderDelete( p_xml, p_xml_reader );
if( p_xml )
xml_Delete( p_xml );
+ if( p_subitems )
+ {
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+ }
vlc_gc_decref(p_current_input);
return -1;
}
else
{
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
p_input = input_item_New( p_demux, psz_src, psz_moviename );
#define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
p_input, "QuickTime Media Link", type, "%s", field ) ; }
SADD_INFO( "href", psz_href );
SADD_INFO( _("Mime"), psz_mimetype );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
if( psz_qtnext )
{
p_input = input_item_New( p_demux, psz_qtnext, NULL );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
}
i_ret = 0; /* Needed for correct operation of go back */
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
psz_line = stream_ReadLine( p_demux->s );
while( psz_line )
{
if( !EMPTY_STR( psz_comments ) ) input_item_SetDescription( p_input, psz_comments );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
free( psz_mrl );
}
b_cleanup = false;
}
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
input_item_AddOption( p_child, "rtsp-kasenna", VLC_INPUT_OPTION_TRUSTED );
input_item_AddSubItem( p_current_input, p_child );
+ input_item_AddSubItem2( p_current_input, p_child );
vlc_gc_decref( p_child );
vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
static int Control( demux_t *p_demux, int i_query, va_list args );
static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
- input_item_t *p_current_input );
+ input_item_node_t *p_input_node );
static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
- input_item_t *p_current_input, bool b_adult );
+ input_item_node_t *p_input_node, bool b_adult );
/*****************************************************************************
* Import_Shoutcast: main import function
goto error;
}
+ input_item_node_t *p_input_node = input_item_node_Create( p_current_input );
+
if( !strcmp( psz_eltname, "genrelist" ) )
{
/* we're reading a genre list */
- if( DemuxGenre( p_demux, p_xml_reader, p_current_input ) )
+ if( DemuxGenre( p_demux, p_xml_reader, p_input_node ) )
goto error;
}
else
{
/* we're reading a station list */
- if( DemuxStation( p_demux, p_xml_reader, p_current_input,
+ if( DemuxStation( p_demux, p_xml_reader, p_input_node,
var_CreateGetBool( p_demux, "shoutcast-show-adult" ) ) )
goto error;
}
+ input_item_AddSubItemTree( p_input_node );
+
i_ret = 0; /* Needed for correct operation of go back */
error:
if( p_xml )
xml_Delete( p_xml );
free( psz_eltname );
+ input_item_node_Delete( p_input_node );
vlc_gc_decref(p_current_input);
return i_ret;
}
* </genrelist>
**/
static int DemuxGenre( demux_t *p_demux, xml_reader_t *p_xml_reader,
- input_item_t *p_current_input )
+ input_item_node_t *p_input_node )
{
char *psz_name = NULL; /* genre name */
int i_ret = -1;
{
input_item_t *p_input;
p_input = input_item_New( p_demux, psz_mrl, psz_name );
- input_item_CopyOptions( p_current_input, p_input );
+ input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
- input_item_AddSubItem( p_current_input, p_input );
+ input_item_AddSubItem( p_input_node->p_item, p_input );
+ input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input );
}
FREENULL( psz_name );
* </stationlist>
**/
static int DemuxStation( demux_t *p_demux, xml_reader_t *p_xml_reader,
- input_item_t *p_current_input, bool b_adult )
+ input_item_node_t *p_input_node, bool b_adult )
{
char *psz_base = NULL; /* */
/* Create the item */
input_item_t *p_input;
p_input = input_item_New( p_demux, psz_mrl, psz_name );
- input_item_CopyOptions( p_current_input, p_input );
+ input_item_CopyOptions( p_input_node->p_item, p_input );
free( psz_mrl );
#define SADD_INFO( type, field ) \
input_item_SetNowPlaying( p_input, psz_ct );
if( psz_rt )
input_item_SetRating( p_input, psz_rt );
- input_item_AddSubItem( p_current_input, p_input );
+ input_item_AddSubItem( p_input_node->p_item, p_input );
+ input_item_node_AppendItem( p_input_node, p_input );
vlc_gc_decref( p_input );
FREENULL( psz_base );
FREENULL( psz_name );
char *psz_line;
input_item_t *p_current_input = GetCurrentItem(p_demux);
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
while( (psz_line = stream_ReadLine( p_demux->s )) )
{
char *psz_parse = psz_line;
p_input = input_item_NewExt( p_demux, psz_uri, psz_uri,
0, NULL, 0, -1 );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
+ vlc_gc_decref( p_input );
}
}
free( psz_line );
}
+
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+
vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "wpl-extvlcopt" );
return 0; /* Needed for correct operation of go back */
psz_line = stream_ReadLine( p_demux->s );
}
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
/* Loop on all lines */
while( psz_line )
{
input_item_t *p_input = input_item_NewExt( p_demux, psz_mrl,
psz_title, 0, NULL, 0, i_duration );
input_item_AddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
FREENULL( psz_mrl );
FREENULL( psz_title );
i_duration = -1;
SET( psz_copyright, Copyright );
#undef SET
+ vlc_gc_decref( p_input );
}
else
msg_Warn( p_demux, "invalid line '%s'", psz_parse );
psz_line = stream_ReadLine( p_demux->s );
}
+ input_item_AddSubItemTree( p_subitems );
+ input_item_node_Delete( p_subitems );
+
vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "zpl-extvlcopt" );
return 0; /* Needed for correct operation of go back */
if( !p_input ) continue;
/* Add the item */
- /* FIXME: playlist_BothAddInput() can fail */
PL_LOCK;
- playlist_BothAddInput( p_playlist, p_input, p_node,
+ playlist_NodeAddInput( p_playlist, p_input, p_node,
PLAYLIST_INSERT,
i_position == -1 ?
PLAYLIST_END : i_position + i_item,
- NULL, NULL, pl_Locked );
+ pl_Locked );
if( i_item == 0 && !b_enqueue )
/* Initialisation of the playlist */
playlist_t * p_playlist = THEPL;
PL_LOCK;
- playlist_item_t *p_root =
- playlist_GetPreferredNode( THEPL, THEPL->p_local_category );
+ playlist_item_t *p_root = THEPL->p_playing;
+
PL_UNLOCK;
rightPanel = new StandardPLPanel( this, p_intf, THEPL, p_root );
QPL_LOCK;
assert( p_item );
- playlist_item_t *p_pref_item = playlist_GetPreferredNode( THEPL, p_item );
- if( p_pref_item ) p_item = p_pref_item;
-
/* needed for popupAdd() */
currentRootId = p_item->i_id;
playlist_Lock( THEPL );
playlist_item_t *p_item = playlist_ItemGetByInput( THEPL, p_input );
- assert( p_item != NULL );
+ if( !p_item )
+ {
+ playlist_Unlock( THEPL );
+ return;
+ }
QModelIndex index = model->index( p_item->i_id, 0 );
+
+ playlist_Unlock( THEPL );
+
if( currentView == iconView ) {
iconView->setRootIndex( index );
locationBar->setIndex( index );
last_activated_id = -1;
- playlist_Unlock( THEPL );
+
}
LocationBar::LocationBar( PLModel *m )
/* Append item to playlist */
if( p_parent ) /* Add to node */
+ {
input_item_AddSubItem( p_parent, p_input );
+ input_item_AddSubItem2( p_parent, p_input );
+ }
else /* Play or Enqueue (preparse) */
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput( p_playlist, p_input,
ItemNode *iNode = (ItemNode *)node;
input_item_t *p_input = input_item_New( p_sd, iNode->getResource(), title );
/* FIXME: playlist_AddInput() can fail */
- playlist_BothAddInput( p_playlist, p_input, p_parent,
- PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL,
+ playlist_NodeAddInput( p_playlist, p_input, p_parent,
+ PLAYLIST_APPEND, PLAYLIST_END,
false );
vlc_gc_decref( p_input );
} else if ( node->isContainerNode() )