memcpy( psz_string, psz_backup, i_strlen );
psz_string[i_strlen] = '\0';
p_input = input_ItemNew( p_playlist, psz_string, psz_title_asx );
- input_ItemCopyOptions( p_current->p_input, p_input );
- playlist_BothAddInput( p_playlist, p_input,
- p_item_in_category,
- PLAYLIST_APPEND|PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL,
- VLC_FALSE);
+ input_ItemCopyOptions( p_current_input, p_input );
+ input_ItemAddSubItem( p_current_input, p_input );
free( psz_string );
}
else continue;
if( p_sys->b_skip_ads && b_skip_entry )
{
msg_Dbg( p_demux, "skipped entry %d %s (%s)",
- i_entry_count, ( psz_title_entry ? psz_title_entry : p_current->p_input->psz_name ), psz_href );
+ i_entry_count, ( psz_title_entry ? psz_title_entry : p_current_input->psz_name ), psz_href );
}
else
{
}
/* create the new entry */
- asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : p_current->p_input->psz_name ) );
+ asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : p_current_input->psz_name ) );
p_entry = input_ItemNewExt( p_playlist, psz_href, psz_name, i_options, (const char * const *)ppsz_options, -1 );
FREENULL( psz_name );
- input_ItemCopyOptions( p_current->p_input, p_entry );
+ input_ItemCopyOptions( p_current_input, p_entry );
while( i_options )
{
psz_name = ppsz_options[--i_options];
if( psz_copyright_entry ) input_item_SetCopyright( p_entry, psz_copyright_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 );
- playlist_BothAddInput( p_playlist, p_entry,
- p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE
- , PLAYLIST_END, NULL, NULL,
- VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_entry );
}
/* cleanup entry */
}
else if( !strncasecmp( psz_parse, "</ASX", 5 ) )
{
- vlc_mutex_lock( &p_current->p_input->lock );
- if( psz_title_asx ) input_item_SetTitle( p_current->p_input, psz_title_asx );
- if( psz_artist_asx ) input_item_SetArtist( p_current->p_input, psz_artist_asx );
- if( psz_copyright_asx ) input_item_SetCopyright( p_current->p_input, psz_copyright_asx );
- if( psz_moreinfo_asx ) input_item_SetURL( p_current->p_input, psz_moreinfo_asx );
- if( psz_abstract_asx ) input_item_SetDescription( p_current->p_input, psz_abstract_asx );
- vlc_mutex_unlock( &p_current->p_input->lock );
+ vlc_mutex_lock( &p_current_input->lock );
+ if( psz_title_asx ) input_item_SetTitle( p_current_input, psz_title_asx );
+ if( psz_artist_asx ) input_item_SetArtist( p_current_input, psz_artist_asx );
+ if( psz_copyright_asx ) input_item_SetCopyright( p_current_input, psz_copyright_asx );
+ if( psz_moreinfo_asx ) input_item_SetURL( p_current_input, psz_moreinfo_asx );
+ if( psz_abstract_asx ) input_item_SetDescription( p_current_input, psz_abstract_asx );
+ vlc_mutex_unlock( &p_current_input->lock );
FREENULL( psz_base_asx );
FREENULL( psz_title_asx );
FREENULL( psz_artist_asx );
}
else if( !strcmp( psz_name, "label" ) )
{
- playlist_ItemSetName( p_current, psz_value );
+ input_ItemSetName( p_current_input, psz_value );
}
else
{
if( psz_bitrate )
msg_Err( p_playlist, "Unsupported meta bitrate" );
- playlist_BothAddInput( p_playlist, p_input,
- p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
FREENULL( psz_name );
FREENULL( psz_mrl );
FREENULL( psz_genre );
EnsureUTF8( ppsz_options[i] );
input_ItemAddOption( p_input, ppsz_options[i] );
}
- playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
while( i_options-- ) free( ppsz_options[i_options] );
if( ppsz_options ) free( ppsz_options );
struct demux_sys_t
{
playlist_t *p_playlist;
- playlist_item_t *p_current;
- playlist_item_t *p_item_in_category;
+ input_item_t *p_current_input;
};
/*****************************************************************************
INIT_PLAYLIST_STUFF;
p_sys->p_playlist = p_playlist;
- p_sys->p_current = p_current;
- p_sys->p_item_in_category = p_item_in_category;
+ p_sys->p_current_input = p_current_input;
while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
{
SADD_INFO( "gvp_version", psz_version );
SADD_INFO( "docid", psz_docid );
SADD_INFO( "description", psz_description );
- playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
}
HANDLE_PLAY_AND_RELEASE;
snprintf( psz_url, len+1, "dvd://%s", p_demux->psz_path );
p_input = input_ItemNewExt( p_playlist, psz_url, psz_url, 0, NULL, -1 );
- playlist_BothAddInput( p_playlist, p_input,
- p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
HANDLE_PLAY_AND_RELEASE;
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
- const char *psz_vlcpath = config_GetDataDir();
+ const char *psz_vlcpath = NULL;//config_GetDataDir();
if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "luaplaylist", psz_vlcpath ) < 0 )
return VLC_ENOMEM;
if( asprintf( &ppsz_dir_list[2], "%s" DIR_SEP "share" DIR_SEP "luaplaylist", psz_vlcpath ) < 0 )
p_input );
/* Append item to playlist */
- playlist_BothAddInput(
- p_playlist, p_input,
- p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
while( i_options > 0 )
free( ppsz_options[--i_options] );
if ( psz_artist && *psz_artist )
input_ItemAddInfo( p_input, _(VLC_META_INFO_CAT),
_(VLC_META_ARTIST), "%s", psz_artist );
- playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
free( psz_mrl );
}
#define INIT_PLAYLIST_STUFF \
playlist_t *p_playlist = pl_Yield( p_demux ); \
- vlc_bool_t b_play = var_CreateGetBool( p_demux, "playlist-autostart" ); \
input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
- input_item_t *p_current_input = input_GetItem( p_input_thread ); \
- playlist_item_t *p_current = \
- playlist_ItemGetByInput( p_playlist, p_current_input, VLC_FALSE ); \
- playlist_item_t *p_item_in_category = \
- playlist_ItemToNode( p_playlist, p_current, \
- VLC_TRUE ); \
- b_play = b_play && p_current == p_playlist->status.p_item; \
- if( p_item_in_category ) \
- p_item_in_category->p_input->i_type = ITEM_TYPE_PLAYLIST;
+ input_item_t *p_current_input = input_GetItem( p_input_thread );
#define HANDLE_PLAY_AND_RELEASE \
- /* Go back and play the playlist */ \
- if( b_play && p_item_in_category ) \
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, p_item_in_category, NULL ); \
vlc_object_release( p_input_thread ); \
vlc_object_release( p_playlist );
{
p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,
0, NULL, -1 );
- input_ItemCopyOptions( p_current->p_input, p_input );
- playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemCopyOptions( p_current_input, p_input );
+ input_ItemAddSubItem( p_current_input, p_input );
}
else
{
if( psz_mrl )
{
p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,0, NULL, -1 );
- input_ItemCopyOptions( p_current->p_input, p_input );
- playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemCopyOptions( p_current_input, p_input );
+ input_ItemAddSubItem( p_current_input, p_input );
free( psz_mrl_orig );
psz_mrl = NULL;
}
else if( b_item == VLC_FALSE && b_image == VLC_FALSE
&& !strcmp( psz_elname, "title" ) )
{
- playlist_ItemSetName( p_current, psz_text );
+ input_ItemSetName( p_current_input, psz_text );
}
#define ADD_GINFO( info, name ) \
else if( !b_item && !b_image && !strcmp( psz_elname, name ) ) \
{ \
- input_ItemAddInfo( p_current->p_input, _("Podcast Info"), \
+ input_ItemAddInfo( p_current_input, _("Podcast Info"), \
_( info ), "%s", psz_text ); \
}
ADD_GINFO( "Podcast Link", "link" )
&& ( !strcmp( psz_elname, "itunes:summary" )
||!strcmp( psz_elname, "description" ) ) )
{ /* <description> isn't standard iTunes podcast stuff */
- input_ItemAddInfo( p_current->p_input,
+ input_ItemAddInfo( p_current_input,
_( "Podcast Info" ), _( "Podcast Summary" ),
"%s", psz_text );
}
"%s bytes",
psz_item_size );
}
- playlist_BothAddInput( p_playlist, p_input,
- p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE
- , PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
FREENULL( psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_size );
struct demux_sys_t
{
playlist_t *p_playlist;
- playlist_item_t *p_current;
- playlist_item_t *p_item_in_category;
+ input_item_t *p_current_input;
xml_t *p_xml;
xml_reader_t *p_xml_reader;
INIT_PLAYLIST_STUFF;
p_sys->p_playlist = p_playlist;
- p_sys->p_current = p_current;
- p_sys->p_item_in_category = p_item_in_category;
+ p_sys->p_current_input = p_current_input;
p_xml = p_sys->p_xml = xml_Create( p_demux );
if( !p_xml ) return -1;
p_input, "QuickTime Media Link", _(type), "%s", field ) ; }
SADD_INFO( "href", psz_href );
SADD_INFO( "mime type", psz_mimetype );
- playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
if( psz_qtnext )
{
p_input = input_ItemNewExt( p_sys->p_playlist,
psz_qtnext, NULL, 0, NULL, -1 );
- playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_input );
}
}
return VLC_EGENERIC;
}
- input_ItemCopyOptions( p_current->p_input, p_child );
+ input_ItemCopyOptions( p_current_input, p_child );
if( p_sys->i_packet_size && p_sys->psz_mcast_ip )
{
char *psz_option;
free( psz_option );
}
- playlist_BothAddInput( p_playlist, p_child, p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE, PLAYLIST_END,
- NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_current_input, p_child );
HANDLE_PLAY_AND_RELEASE
return -1; /* Needed for correct operation of go back */
}
struct demux_sys_t
{
playlist_t *p_playlist;
- playlist_item_t *p_current;
- playlist_item_t *p_item_in_category;
+ input_item_t *p_current_input;
xml_t *p_xml;
xml_reader_t *p_xml_reader;
char *psz_eltname = NULL;
INIT_PLAYLIST_STUFF;
p_sys->p_playlist = p_playlist;
- p_sys->p_current = p_current;
- p_sys->p_item_in_category = p_item_in_category;
+ p_sys->p_current_input = p_current_input;
p_xml = p_sys->p_xml = xml_Create( p_demux );
if( !p_xml ) return -1;
psz_name );
p_input = input_ItemNewExt( p_sys->p_playlist, psz_mrl,
psz_name, 0, NULL, -1 );
- input_ItemCopyOptions( p_sys->p_current->p_input,
+ input_ItemCopyOptions( p_sys->p_current_input,
p_input );
free( psz_mrl );
- playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_sys->p_current_input, p_input );
FREENULL( psz_name );
}
FREENULL( psz_eltname );
psz_name , 0, NULL, -1 );
free( psz_mrl );
- input_ItemCopyOptions( p_sys->p_current->p_input,
+ input_ItemCopyOptions( p_sys->p_current_input,
p_input );
#define SADD_INFO( type, field ) if( field ) { input_ItemAddInfo( \
input_item_SetNowPlaying( p_input, psz_ct );
if( psz_rt )
input_item_SetRating( p_input, psz_rt );
-
- playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_sys->p_current_input, p_input );
FREENULL( psz_name );
FREENULL( psz_mt )
xml_reader_t *p_xml_reader = NULL;
char *psz_name = NULL;
INIT_PLAYLIST_STUFF;
- p_demux->p_sys->p_item_in_category = p_item_in_category;
p_demux->p_sys->pp_tracklist = NULL;
p_demux->p_sys->i_tracklist_entries = 0;
p_demux->p_sys->i_identifier = 0;
FREE_NAME();
}
- i_ret = parse_playlist_node( p_demux, p_playlist, p_current, NULL,
+ i_ret = parse_playlist_node( p_demux, p_playlist, p_current_input,
p_xml_reader, "playlist" );
HANDLE_PLAY_AND_RELEASE;
if( p_xml_reader )
* \brief parse the root node of a XSPF playlist
* \param p_demux demuxer instance
* \param p_playlist playlist instance
- * \param p_item current playlist item
- * \param p_input current input item
+ * \param p_input_item current input item
* \param p_xml_reader xml reader instance
* \param psz_element name of element to parse
*/
{
if( p_handler->pf_handler.cmplx( p_demux,
p_playlist,
- p_item,NULL,
+ p_input_item,
p_xml_reader,
p_handler->name ) )
{
if( p_handler->pf_handler.smpl )
{
- p_handler->pf_handler.smpl( p_item, NULL, p_handler->name,
+ p_handler->pf_handler.smpl( p_input_item, p_handler->name,
psz_value );
}
FREE_ATT();
FREE_NAME();
/* parse the track data in a separate function */
- if( parse_track_node( p_demux, p_playlist, p_item, NULL,
+ if( parse_track_node( p_demux, p_playlist, p_input_item,
p_xml_reader,"track" ) == VLC_TRUE )
i_ntracks++;
}
}
if( p_handler->pf_handler.cmplx( p_demux,
p_playlist,
- NULL, p_new_input,
+ p_new_input,
p_xml_reader,
p_handler->name ) )
{
if( !strcmp( psz_name, psz_element ) )
{
FREE_ATT();
- playlist_BothAddInput( p_playlist, p_new_input,
- p_demux->p_sys->p_item_in_category,
- PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
- PLAYLIST_END, NULL, NULL, VLC_FALSE );
+ input_ItemAddSubItem( p_input_item, p_new_input );
if( p_demux->p_sys->i_identifier <
p_demux->p_sys->i_tracklist_entries )
{
p_new_input = input_ItemNewExt( p_playlist, psz_uri,
NULL, 0, NULL, -1 );
free( psz_uri );
- input_ItemCopyOptions( p_item->p_input, p_new_input );
+ input_ItemCopyOptions( p_input_item, p_new_input );
psz_uri = NULL;
FREE_ATT();
p_handler = NULL;
}
if( p_handler->pf_handler.smpl )
{
- p_handler->pf_handler.smpl( NULL, p_new_input,
+ p_handler->pf_handler.smpl( p_new_input,
p_handler->name,
psz_value );
FREE_ATT();
{
if( p_handler->pf_handler.cmplx( p_demux,
p_playlist,
- p_item, NULL,
+ p_input_item,
p_xml_reader,
p_handler->name ) )
{
if( p_handler->pf_handler.smpl )
{
- p_handler->pf_handler.smpl( p_item, NULL, p_handler->name,
+ p_handler->pf_handler.smpl( p_input_item, p_handler->name,
psz_value );
}
FREE_ATT();
#define SIMPLE_CONTENT 1
#define COMPLEX_CONTENT 2
-#define SIMPLE_INTERFACE (playlist_item_t *p_item,\
- input_item_t *p_input,\
+#define SIMPLE_INTERFACE (input_item_t *p_input,\
const char *psz_name,\
char *psz_value)
#define COMPLEX_INTERFACE (demux_t *p_demux,\
playlist_t *p_playlist,\
- playlist_item_t *p_item,\
- input_item_t *p_input, \
+ input_item_t *p_input_item,\
xml_reader_t *p_xml_reader,\
const char *psz_element)