Changeset e8aa094f86e08a2c690555a0767763dcd63ffb90
- Timestamp:
- 12/11/06 19:19:49
(2 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1163355589 +0000
- git-parent:
[8b5528ab646fc91e2edb9bdfcd0afd87cbf70859]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1163355589 +0000
- Message:
Preparse playlist items that don't have enough meta
If the item is not to be preparsed but has enough meta, mark it as preparsed
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| red0b72e |
re8aa094 |
|
| 142 | 142 | #define PLAYLIST_GO 0x0004 |
|---|
| 143 | 143 | #define PLAYLIST_PREPARSE 0x0008 |
|---|
| | 144 | #define PLAYLIST_SPREPARSE 0x0010 |
|---|
| 144 | 145 | |
|---|
| 145 | 146 | #define PLAYLIST_END -666 |
|---|
| r673861d |
re8aa094 |
|
| 129 | 129 | vlc_bool_t b_doing_ml; /**< Doing media library stuff, */ |
|---|
| 130 | 130 | /*get quicker */ |
|---|
| | 131 | vlc_bool_t b_auto_preparse; |
|---|
| 131 | 132 | |
|---|
| 132 | 133 | /* Runtime */ |
|---|
| r2374e7b |
re8aa094 |
|
| 371 | 371 | playlist_BothAddInput( p_playlist, p_input, |
|---|
| 372 | 372 | p_item_in_category, |
|---|
| 373 | | PLAYLIST_APPEND, |
|---|
| 374 | | PLAYLIST_END ); |
|---|
| | 373 | PLAYLIST_APPEND|PLAYLIST_SPREPARSE, |
|---|
| | 374 | PLAYLIST_END ); |
|---|
| 375 | 375 | free( psz_string ); |
|---|
| 376 | 376 | } |
|---|
| … | … | |
| 451 | 451 | playlist_BothAddInput( p_playlist, p_entry, |
|---|
| 452 | 452 | p_item_in_category, |
|---|
| 453 | | PLAYLIST_APPEND, PLAYLIST_END); |
|---|
| | 453 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE |
|---|
| | 454 | , PLAYLIST_END); |
|---|
| 454 | 455 | free( psz_string ); |
|---|
| 455 | 456 | } |
|---|
| r2374e7b |
re8aa094 |
|
| 269 | 269 | playlist_BothAddInput( p_playlist, p_input, |
|---|
| 270 | 270 | p_item_in_category, |
|---|
| 271 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 271 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 272 | PLAYLIST_END ); |
|---|
| 272 | 273 | FREENULL( psz_name ); |
|---|
| 273 | 274 | FREENULL( psz_mrl ); |
|---|
| r2374e7b |
re8aa094 |
|
| 120 | 120 | } |
|---|
| 121 | 121 | playlist_BothAddInput( p_playlist, p_input, p_item_in_category, |
|---|
| 122 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 122 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 123 | PLAYLIST_END ); |
|---|
| 123 | 124 | |
|---|
| 124 | 125 | while( i_options-- ) free( ppsz_options[i_options] ); |
|---|
| r2374e7b |
re8aa094 |
|
| 216 | 216 | playlist_BothAddInput( p_sys->p_playlist, p_input, |
|---|
| 217 | 217 | p_sys->p_item_in_category, |
|---|
| 218 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 218 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 219 | PLAYLIST_END ); |
|---|
| 219 | 220 | } |
|---|
| 220 | 221 | |
|---|
| r2374e7b |
re8aa094 |
|
| 170 | 170 | _(VLC_META_ARTIST), "%s", psz_artist ); |
|---|
| 171 | 171 | playlist_BothAddInput( p_playlist, p_input, p_item_in_category, |
|---|
| 172 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 172 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 173 | PLAYLIST_END ); |
|---|
| 173 | 174 | free( psz_mrl ); |
|---|
| 174 | 175 | } |
|---|
| r2374e7b |
re8aa094 |
|
| 158 | 158 | input_ItemCopyOptions( p_current->p_input, p_input ); |
|---|
| 159 | 159 | playlist_BothAddInput( p_playlist, p_input, p_item_in_category, |
|---|
| 160 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 160 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 161 | PLAYLIST_END ); |
|---|
| 161 | 162 | } |
|---|
| 162 | 163 | else |
|---|
| … | … | |
| 214 | 215 | input_ItemCopyOptions( p_current->p_input, p_input ); |
|---|
| 215 | 216 | playlist_BothAddInput( p_playlist, p_input, p_item_in_category, |
|---|
| 216 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 217 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 218 | PLAYLIST_END ); |
|---|
| 217 | 219 | free( psz_mrl_orig ); |
|---|
| 218 | 220 | psz_mrl = NULL; |
|---|
| r2374e7b |
re8aa094 |
|
| 294 | 294 | playlist_BothAddInput( p_playlist, p_input, |
|---|
| 295 | 295 | p_item_in_category, |
|---|
| 296 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 296 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE |
|---|
| | 297 | , PLAYLIST_END ); |
|---|
| 297 | 298 | FREENULL( psz_item_name ); |
|---|
| 298 | 299 | FREENULL( psz_item_mrl ); |
|---|
| r2374e7b |
re8aa094 |
|
| 362 | 362 | SADD_INFO( "mime type", psz_mimetype ); |
|---|
| 363 | 363 | playlist_BothAddInput( p_sys->p_playlist, p_input, |
|---|
| 364 | | p_sys->p_item_in_category, PLAYLIST_APPEND, |
|---|
| | 364 | p_sys->p_item_in_category, |
|---|
| | 365 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| 365 | 366 | PLAYLIST_END ); |
|---|
| 366 | 367 | if( psz_qtnext ) |
|---|
| … | … | |
| 370 | 371 | playlist_BothAddInput( p_sys->p_playlist, p_input, |
|---|
| 371 | 372 | p_sys->p_item_in_category, |
|---|
| 372 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 373 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 374 | PLAYLIST_END ); |
|---|
| 373 | 375 | } |
|---|
| 374 | 376 | } |
|---|
| r2374e7b |
re8aa094 |
|
| 408 | 408 | |
|---|
| 409 | 409 | playlist_BothAddInput( p_playlist, p_child, p_item_in_category, |
|---|
| 410 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 410 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, PLAYLIST_END ); |
|---|
| 411 | 411 | HANDLE_PLAY_AND_RELEASE |
|---|
| 412 | 412 | return -1; /* Needed for correct operation of go back */ |
|---|
| r2374e7b |
re8aa094 |
|
| 243 | 243 | playlist_BothAddInput( p_sys->p_playlist, p_input, |
|---|
| 244 | 244 | p_sys->p_item_in_category, |
|---|
| 245 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 245 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 246 | PLAYLIST_END ); |
|---|
| 246 | 247 | FREENULL( psz_name ); |
|---|
| 247 | 248 | } |
|---|
| … | … | |
| 434 | 435 | playlist_BothAddInput( p_sys->p_playlist, p_input, |
|---|
| 435 | 436 | p_sys->p_item_in_category, |
|---|
| 436 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 437 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 438 | PLAYLIST_END ); |
|---|
| 437 | 439 | |
|---|
| 438 | 440 | FREENULL( psz_name ); |
|---|
| r2374e7b |
re8aa094 |
|
| 482 | 482 | playlist_BothAddInput( p_playlist, p_new_input, |
|---|
| 483 | 483 | p_demux->p_sys->p_item_in_category, |
|---|
| 484 | | PLAYLIST_APPEND, PLAYLIST_END ); |
|---|
| | 484 | PLAYLIST_APPEND | PLAYLIST_SPREPARSE, |
|---|
| | 485 | PLAYLIST_END ); |
|---|
| 485 | 486 | if( p_demux->p_sys->i_identifier < |
|---|
| 486 | 487 | p_demux->p_sys->i_tracklist_entries ) |
|---|
| rd3217fc |
re8aa094 |
|
| 54 | 54 | { |
|---|
| 55 | 55 | playlist_t *p_playlist; |
|---|
| | 56 | vlc_bool_t b_save; |
|---|
| 56 | 57 | int i_tree; |
|---|
| 57 | 58 | |
|---|
| … | … | |
| 90 | 91 | |
|---|
| 91 | 92 | p_playlist->b_doing_ml = VLC_FALSE; |
|---|
| | 93 | |
|---|
| | 94 | p_playlist->b_auto_preparse = |
|---|
| | 95 | var_CreateGetBool( p_playlist, "auto-preparse") ; |
|---|
| 92 | 96 | |
|---|
| 93 | 97 | p_playlist->p_root_category = playlist_NodeCreate( p_playlist, NULL, NULL); |
|---|
| … | … | |
| 133 | 137 | |
|---|
| 134 | 138 | vlc_object_attach( p_playlist, p_parent ); |
|---|
| 135 | | |
|---|
| | 139 | b_save = p_playlist->b_auto_preparse; |
|---|
| | 140 | p_playlist->b_auto_preparse = VLC_FALSE; |
|---|
| 136 | 141 | playlist_MLLoad( p_playlist ); |
|---|
| | 142 | p_playlist->b_auto_preparse = VLC_TRUE; |
|---|
| 137 | 143 | return p_playlist; |
|---|
| 138 | 144 | } |
|---|
| r3bed3c3 |
re8aa094 |
|
| 575 | 575 | vlc_cond_signal( &p_playlist->object_wait ); |
|---|
| 576 | 576 | } |
|---|
| 577 | | if( i_mode & PLAYLIST_PREPARSE && |
|---|
| 578 | | var_CreateGetBool( p_playlist, "auto-preparse" ) ) |
|---|
| 579 | | { |
|---|
| | 577 | /* Preparse if PREPARSE or SPREPARSE & not enough meta */ |
|---|
| | 578 | if( p_playlist->b_auto_preparse && |
|---|
| | 579 | (i_mode & PLAYLIST_PREPARSE || |
|---|
| | 580 | ( i_mode & PLAYLIST_SPREPARSE && |
|---|
| | 581 | ( !p_item_cat->p_input->p_meta || (p_item_cat->p_input->p_meta && |
|---|
| | 582 | ( EMPTY_STR( p_item_cat->p_input->p_meta->psz_artist ) || |
|---|
| | 583 | EMPTY_STR( p_item_cat->p_input->p_meta->psz_album ) ) |
|---|
| | 584 | ) |
|---|
| | 585 | ) |
|---|
| | 586 | ) ) ) |
|---|
| 580 | 587 | playlist_PreparseEnqueue( p_playlist, p_item_cat->p_input ); |
|---|
| 581 | | } |
|---|
| | 588 | /* If we already have it, signal it */ |
|---|
| | 589 | else if( p_item_cat->p_input->p_meta && |
|---|
| | 590 | !EMPTY_STR( p_item_cat->p_input->p_meta->psz_artist ) && |
|---|
| | 591 | !EMPTY_STR( p_item_cat->p_input->p_meta->psz_album ) ) |
|---|
| | 592 | p_item_cat->p_input->p_meta->i_status = ITEM_PREPARSED; |
|---|
| 582 | 593 | } |
|---|
| 583 | 594 | |
|---|