others: if we only have a path and no interesting name, let the core decide what name to use
free( mrl );
mrl = tmp;
- if( !*psz_name )
- {
- p_input = E_(MRLParse)( p_intf, mrl, mrl );
- }
- else
- {
- p_input = E_(MRLParse)( p_intf, mrl, psz_name );
- }
+ p_input = E_(MRLParse)( p_intf, mrl, psz_name );
if( !p_input || !p_input->psz_uri || !*p_input->psz_uri )
{
/* Now create a playlist item */
if( psz_item_mrl )
{
- p_item = input_ItemNew( p_intf, psz_item_mrl, psz_item_mrl );
+ p_item = input_ItemNew( p_intf, psz_item_mrl, NULL );
for( i = 0; i < i_options; i++ )
{
input_ItemAddOption( p_item, ppsz_options[i] );
demux_t *p_demux = (demux_t *)p_this;
byte_t *p_peek;
+ /* FIXME: we need to skip comment lines !!!! */
CHECK_PEEK( p_peek, 12 );
if( !POKE( p_peek, "gvp_version:", 12 ) )
{
if( psz_qtnext )
{
p_input = input_ItemNewExt( p_sys->p_playlist,
- psz_qtnext, psz_qtnext, 0, NULL, -1 );
+ psz_qtnext, NULL, 0, NULL, -1 );
playlist_AddWhereverNeeded( p_sys->p_playlist, p_input,
p_sys->p_current, p_sys->p_item_in_category,
(p_sys->i_parent_id > 0 ) ? VLC_TRUE: VLC_FALSE,
if( p_playlist )
{
- playlist_PlaylistAdd( p_playlist, path.Path(), path.Path(),
+ playlist_PlaylistAdd( p_playlist, path.Path(), NULL,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
}
foreach( file, files )
{
const char * psz_utf8 = qtu( file );
- playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8,
+ playlist_PlaylistAdd( THEPL, psz_utf8, NULL,
PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END );
}
}
{
const char * psz_utf8 = qtu( files[i] );
/* Play the first one, parse and enqueue the other ones */
- playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8,
+ playlist_PlaylistAdd( THEPL, psz_utf8, NULL,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
( i ? PLAYLIST_PREPARSE : 0 ),
PLAYLIST_END );
QString dir = QFileDialog::getExistingDirectory ( 0,
_("Open directory") );
const char *psz_utf8 = qtu( dir );
- input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8,
+ input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL,
0, NULL, -1 );
playlist_PlaylistAddInput( THEPL, p_input,
PLAYLIST_APPEND, PLAYLIST_END );
QString dir = QFileDialog::getExistingDirectory ( 0,
_("Open directory") );
const char *psz_utf8 = qtu( dir );
- input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8,
+ input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL,
0, NULL, -1 );
playlist_MLAddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END );
input_Read( THEPL, p_input, VLC_FALSE );
if( m_playNow )
{
// Enqueue and play the item
- playlist_PlaylistAdd( pPlaylist, m_name.c_str(),m_name.c_str(),
+ playlist_PlaylistAdd( pPlaylist, m_name.c_str(), NULL,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
else
{
// Enqueue the item only
- playlist_PlaylistAdd( pPlaylist, m_name.c_str(), m_name.c_str(),
+ playlist_PlaylistAdd( pPlaylist, m_name.c_str(), NULL,
PLAYLIST_APPEND, PLAYLIST_END );
}
}
{
char *psz_utf8 = wxFromLocale( paths[i] );
if( event.GetInt() )
- playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8,
+ playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) |
(i ? PLAYLIST_PREPARSE : 0 ),
PLAYLIST_END );
else
- playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8,
+ playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
PLAYLIST_APPEND | PLAYLIST_PREPARSE , PLAYLIST_END );
wxLocaleFree( psz_utf8 );
}
{
wxString path = p_dir_dialog->GetPath();
char *psz_utf8 = wxFromLocale( path );
- playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8,
+ playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0),
PLAYLIST_END );
wxLocaleFree( psz_utf8 );
char *psz_utf8;
psz_utf8 = wxFromLocale( mrl[i] );
- p_input = input_ItemNew( p_intf, psz_utf8, psz_utf8 );
+ p_input = input_ItemNew( p_intf, psz_utf8, NULL );
wxLocaleFree( psz_utf8 );
/* Insert options */
{
char *psz_utf8 = wxDnDFromLocale( filenames[i] );
- playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8,
+ playlist_PlaylistAdd( p_playlist, psz_utf8, NULL,
PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO),
PLAYLIST_END );
else
p_input->psz_uri = NULL;
- if( psz_name != NULL )
- p_input->psz_name = strdup( psz_name );
- else
- p_input->psz_name = strdup ( p_input->psz_uri );
-
p_input->i_type = i_type;
p_input->b_prefers_tree = VLC_FALSE;
if( p_input->i_type == ITEM_TYPE_UNKNOWN )
GuessType( p_input );
+ if( psz_name != NULL )
+ p_input->psz_name = strdup( psz_name );
+ else if( p_input->i_type == ITEM_TYPE_AFILE
+ || p_input->i_type == ITEM_TYPE_VFILE )
+ {
+ char *psz_filename = strrchr( p_input->psz_uri, DIR_SEP_CHAR );
+ if( psz_filename && *psz_filename == DIR_SEP_CHAR )
+ psz_filename++;
+ p_input->psz_name = strdup( psz_filename && *psz_filename
+ ? psz_filename : p_input->psz_uri );
+ }
+ else
+ p_input->psz_name = strdup( p_input->psz_uri );
+
p_input->i_duration = i_duration;
p_input->ppsz_options = NULL;
var_Get( p_libvlc_global, "libvlc", &lockval );
vlc_mutex_lock( lockval.p_address );
-
-
i_instances++;
if( !libvlc_global.b_ready )
int i_err;
LIBVLC_PLAYLIST_FUNC;
i_err = playlist_PlaylistAddExt( p_libvlc->p_playlist, psz_target,
- psz_target, i_mode, i_pos, -1,
+ NULL, i_mode, i_pos, -1,
ppsz_options, i_options );
LIBVLC_PLAYLIST_FUNC_END;
return i_err;
if( i_opt || config_GetInt( p_this, "playlist-enqueue" ) )
{
playlist_PlaylistAddExt( p_playlist, ppsz_argv[i_opt],
- ppsz_argv[i_opt], PLAYLIST_APPEND ,
+ NULL, PLAYLIST_APPEND ,
PLAYLIST_END, -1,
(char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),
i_options );
} else {
playlist_PlaylistAddExt( p_playlist, ppsz_argv[i_opt],
- ppsz_argv[i_opt], PLAYLIST_APPEND | PLAYLIST_GO,
+ NULL, PLAYLIST_APPEND | PLAYLIST_GO,
PLAYLIST_END, -1,
(char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),
i_options );