Changeset 2ffa2bd3d0a506be2a6c9e53edffeee442350397
- Timestamp:
- 01/10/06 21:07:48
(2 years ago)
- Author:
- Antoine Cellerier <dionoea@videolan.org>
- git-committer:
- Antoine Cellerier <dionoea@videolan.org> 1159729668 +0000
- git-parent:
[19f542a35b43fadc821547fea49f7cbd90ad0b69]
- git-author:
- Antoine Cellerier <dionoea@videolan.org> 1159729668 +0000
- Message:
src/input/item.c: if we don't have an item name and item is a file, then only use the filename (and not the full path) as the item's name
others: if we only have a path and no interesting name, let the core decide what name to use
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r857b51f |
r2ffa2bd |
|
| 844 | 844 | mrl = tmp; |
|---|
| 845 | 845 | |
|---|
| 846 | | if( !*psz_name ) |
|---|
| 847 | | { |
|---|
| 848 | | p_input = E_(MRLParse)( p_intf, mrl, mrl ); |
|---|
| 849 | | } |
|---|
| 850 | | else |
|---|
| 851 | | { |
|---|
| 852 | | p_input = E_(MRLParse)( p_intf, mrl, psz_name ); |
|---|
| 853 | | } |
|---|
| | 846 | p_input = E_(MRLParse)( p_intf, mrl, psz_name ); |
|---|
| 854 | 847 | |
|---|
| 855 | 848 | if( !p_input || !p_input->psz_uri || !*p_input->psz_uri ) |
|---|
| r9ec7c59 |
r2ffa2bd |
|
| 2291 | 2291 | if( psz_item_mrl ) |
|---|
| 2292 | 2292 | { |
|---|
| 2293 | | p_item = input_ItemNew( p_intf, psz_item_mrl, psz_item_mrl ); |
|---|
| | 2293 | p_item = input_ItemNew( p_intf, psz_item_mrl, NULL ); |
|---|
| 2294 | 2294 | for( i = 0; i < i_options; i++ ) |
|---|
| 2295 | 2295 | { |
|---|
| r857b51f |
r2ffa2bd |
|
| 69 | 69 | byte_t *p_peek; |
|---|
| 70 | 70 | |
|---|
| | 71 | /* FIXME: we need to skip comment lines !!!! */ |
|---|
| 71 | 72 | CHECK_PEEK( p_peek, 12 ); |
|---|
| 72 | 73 | if( !POKE( p_peek, "gvp_version:", 12 ) ) |
|---|
| r857b51f |
r2ffa2bd |
|
| 370 | 370 | { |
|---|
| 371 | 371 | p_input = input_ItemNewExt( p_sys->p_playlist, |
|---|
| 372 | | psz_qtnext, psz_qtnext, 0, NULL, -1 ); |
|---|
| | 372 | psz_qtnext, NULL, 0, NULL, -1 ); |
|---|
| 373 | 373 | playlist_AddWhereverNeeded( p_sys->p_playlist, p_input, |
|---|
| 374 | 374 | p_sys->p_current, p_sys->p_item_in_category, |
|---|
| r91c5596 |
r2ffa2bd |
|
| 750 | 750 | if( p_playlist ) |
|---|
| 751 | 751 | { |
|---|
| 752 | | playlist_PlaylistAdd( p_playlist, path.Path(), path.Path(), |
|---|
| | 752 | playlist_PlaylistAdd( p_playlist, path.Path(), NULL, |
|---|
| 753 | 753 | PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); |
|---|
| 754 | 754 | } |
|---|
| r18efcf5 |
r2ffa2bd |
|
| 208 | 208 | { |
|---|
| 209 | 209 | const char * psz_utf8 = qtu( file ); |
|---|
| 210 | | playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8, |
|---|
| | 210 | playlist_PlaylistAdd( THEPL, psz_utf8, NULL, |
|---|
| 211 | 211 | PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END ); |
|---|
| 212 | 212 | } |
|---|
| … | … | |
| 233 | 233 | const char * psz_utf8 = qtu( files[i] ); |
|---|
| 234 | 234 | /* Play the first one, parse and enqueue the other ones */ |
|---|
| 235 | | playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8, |
|---|
| | 235 | playlist_PlaylistAdd( THEPL, psz_utf8, NULL, |
|---|
| 236 | 236 | PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | |
|---|
| 237 | 237 | ( i ? PLAYLIST_PREPARSE : 0 ), |
|---|
| … | … | |
| 257 | 257 | _("Open directory") ); |
|---|
| 258 | 258 | const char *psz_utf8 = qtu( dir ); |
|---|
| 259 | | input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8, |
|---|
| | 259 | input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL, |
|---|
| 260 | 260 | 0, NULL, -1 ); |
|---|
| 261 | 261 | playlist_PlaylistAddInput( THEPL, p_input, |
|---|
| … | … | |
| 268 | 268 | _("Open directory") ); |
|---|
| 269 | 269 | const char *psz_utf8 = qtu( dir ); |
|---|
| 270 | | input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8, |
|---|
| | 270 | input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL, |
|---|
| 271 | 271 | 0, NULL, -1 ); |
|---|
| 272 | 272 | playlist_MLAddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| red0b72e |
r2ffa2bd |
|
| 38 | 38 | { |
|---|
| 39 | 39 | // Enqueue and play the item |
|---|
| 40 | | playlist_PlaylistAdd( pPlaylist, m_name.c_str(),m_name.c_str(), |
|---|
| | 40 | playlist_PlaylistAdd( pPlaylist, m_name.c_str(), NULL, |
|---|
| 41 | 41 | PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); |
|---|
| 42 | 42 | } |
|---|
| … | … | |
| 44 | 44 | { |
|---|
| 45 | 45 | // Enqueue the item only |
|---|
| 46 | | playlist_PlaylistAdd( pPlaylist, m_name.c_str(), m_name.c_str(), |
|---|
| | 46 | playlist_PlaylistAdd( pPlaylist, m_name.c_str(), NULL, |
|---|
| 47 | 47 | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| 48 | 48 | } |
|---|
| rdfb262b |
r2ffa2bd |
|
| 447 | 447 | char *psz_utf8 = wxFromLocale( paths[i] ); |
|---|
| 448 | 448 | if( event.GetInt() ) |
|---|
| 449 | | playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8, |
|---|
| | 449 | playlist_PlaylistAdd( p_playlist, psz_utf8, NULL, |
|---|
| 450 | 450 | PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | |
|---|
| 451 | 451 | (i ? PLAYLIST_PREPARSE : 0 ), |
|---|
| 452 | 452 | PLAYLIST_END ); |
|---|
| 453 | 453 | else |
|---|
| 454 | | playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8, |
|---|
| | 454 | playlist_PlaylistAdd( p_playlist, psz_utf8, NULL, |
|---|
| 455 | 455 | PLAYLIST_APPEND | PLAYLIST_PREPARSE , PLAYLIST_END ); |
|---|
| 456 | 456 | wxLocaleFree( psz_utf8 ); |
|---|
| … | … | |
| 478 | 478 | wxString path = p_dir_dialog->GetPath(); |
|---|
| 479 | 479 | char *psz_utf8 = wxFromLocale( path ); |
|---|
| 480 | | playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8, |
|---|
| | 480 | playlist_PlaylistAdd( p_playlist, psz_utf8, NULL, |
|---|
| 481 | 481 | PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0), |
|---|
| 482 | 482 | PLAYLIST_END ); |
|---|
| r857b51f |
r2ffa2bd |
|
| 1170 | 1170 | |
|---|
| 1171 | 1171 | psz_utf8 = wxFromLocale( mrl[i] ); |
|---|
| 1172 | | p_input = input_ItemNew( p_intf, psz_utf8, psz_utf8 ); |
|---|
| | 1172 | p_input = input_ItemNew( p_intf, psz_utf8, NULL ); |
|---|
| 1173 | 1173 | wxLocaleFree( psz_utf8 ); |
|---|
| 1174 | 1174 | |
|---|
| rf485214 |
r2ffa2bd |
|
| 1305 | 1305 | char *psz_utf8 = wxDnDFromLocale( filenames[i] ); |
|---|
| 1306 | 1306 | |
|---|
| 1307 | | playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8, |
|---|
| | 1307 | playlist_PlaylistAdd( p_playlist, psz_utf8, NULL, |
|---|
| 1308 | 1308 | PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO), |
|---|
| 1309 | 1309 | PLAYLIST_END ); |
|---|
| r857b51f |
r2ffa2bd |
|
| 242 | 242 | p_input->psz_uri = NULL; |
|---|
| 243 | 243 | |
|---|
| | 244 | p_input->i_type = i_type; |
|---|
| | 245 | p_input->b_prefers_tree = VLC_FALSE; |
|---|
| | 246 | |
|---|
| | 247 | if( p_input->i_type == ITEM_TYPE_UNKNOWN ) |
|---|
| | 248 | GuessType( p_input ); |
|---|
| | 249 | |
|---|
| 244 | 250 | if( psz_name != NULL ) |
|---|
| 245 | 251 | p_input->psz_name = strdup( psz_name ); |
|---|
| | 252 | else if( p_input->i_type == ITEM_TYPE_AFILE |
|---|
| | 253 | || p_input->i_type == ITEM_TYPE_VFILE ) |
|---|
| | 254 | { |
|---|
| | 255 | char *psz_filename = strrchr( p_input->psz_uri, DIR_SEP_CHAR ); |
|---|
| | 256 | if( psz_filename && *psz_filename == DIR_SEP_CHAR ) |
|---|
| | 257 | psz_filename++; |
|---|
| | 258 | p_input->psz_name = strdup( psz_filename && *psz_filename |
|---|
| | 259 | ? psz_filename : p_input->psz_uri ); |
|---|
| | 260 | } |
|---|
| 246 | 261 | else |
|---|
| 247 | | p_input->psz_name = strdup ( p_input->psz_uri ); |
|---|
| 248 | | |
|---|
| 249 | | p_input->i_type = i_type; |
|---|
| 250 | | p_input->b_prefers_tree = VLC_FALSE; |
|---|
| 251 | | |
|---|
| 252 | | if( p_input->i_type == ITEM_TYPE_UNKNOWN ) |
|---|
| 253 | | GuessType( p_input ); |
|---|
| | 262 | p_input->psz_name = strdup( p_input->psz_uri ); |
|---|
| 254 | 263 | |
|---|
| 255 | 264 | p_input->i_duration = i_duration; |
|---|
| r18efcf5 |
r2ffa2bd |
|
| 163 | 163 | vlc_mutex_lock( lockval.p_address ); |
|---|
| 164 | 164 | |
|---|
| 165 | | |
|---|
| 166 | | |
|---|
| 167 | 165 | i_instances++; |
|---|
| 168 | 166 | |
|---|
| r18efcf5 |
r2ffa2bd |
|
| 316 | 316 | LIBVLC_PLAYLIST_FUNC; |
|---|
| 317 | 317 | i_err = playlist_PlaylistAddExt( p_libvlc->p_playlist, psz_target, |
|---|
| 318 | | psz_target, i_mode, i_pos, -1, |
|---|
| | 318 | NULL, i_mode, i_pos, -1, |
|---|
| 319 | 319 | ppsz_options, i_options ); |
|---|
| 320 | 320 | LIBVLC_PLAYLIST_FUNC_END; |
|---|
| rfcfc11b |
r2ffa2bd |
|
| 323 | 323 | { |
|---|
| 324 | 324 | playlist_PlaylistAddExt( p_playlist, ppsz_argv[i_opt], |
|---|
| 325 | | ppsz_argv[i_opt], PLAYLIST_APPEND , |
|---|
| | 325 | NULL, PLAYLIST_APPEND , |
|---|
| 326 | 326 | PLAYLIST_END, -1, |
|---|
| 327 | 327 | (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ), |
|---|
| … | … | |
| 329 | 329 | } else { |
|---|
| 330 | 330 | playlist_PlaylistAddExt( p_playlist, ppsz_argv[i_opt], |
|---|
| 331 | | ppsz_argv[i_opt], PLAYLIST_APPEND | PLAYLIST_GO, |
|---|
| | 331 | NULL, PLAYLIST_APPEND | PLAYLIST_GO, |
|---|
| 332 | 332 | PLAYLIST_END, -1, |
|---|
| 333 | 333 | (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ), |
|---|