~videolan/vlc/old-trunk

« back to all changes in this revision

Viewing changes to src/playlist/engine.c

  • Committer: dionoea
  • Date: 2006-09-24 22:01:28 UTC
  • Revision ID: vcs-imports@canonical.com-20060924220128-b4976d682fbfa4ac
Some more (mostly) untested stuff:
 * Secondary queue items now have a b_fetch_art flag
 * You can use the playlist_AskForArtEnqueue function to ask for art from an interface. This will enqueue at the begining of the secondary queue
 * other stuff which i don't remember :)
 * (fix issues with previous (and unrelated) DIR_SEP commit)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * engine.c : Run the playlist and handle its control
3
3
 *****************************************************************************
4
4
 * Copyright (C) 1999-2004 the VideoLAN team
5
 
 * $Id: engine.c 16837 2006-09-24 17:11:25Z zorglub $
 
5
 * $Id: engine.c 16840 2006-09-24 22:01:28Z dionoea $
6
6
 *
7
7
 * Authors: Samuel Hocevar <sam@zoy.org>
8
8
 *          Clément Stenac <zorglub@videolan.org>
459
459
        if( p_current )
460
460
        {
461
461
            vlc_bool_t b_preparsed = VLC_FALSE;
 
462
            preparse_item_t p;
462
463
            if( strncmp( p_current->psz_uri, "http:", 5 ) &&
463
464
                strncmp( p_current->psz_uri, "rtsp:", 5 ) &&
464
465
                strncmp( p_current->psz_uri, "udp:", 4 ) &&
488
489
             * TODO: - use i_mandatory stuff here instead of hardcoded T/A
489
490
             *       - don't do this for things we won't get meta for, like
490
491
             *         videos
 
492
             * -> done in input_MetaFetch atm
491
493
             */
492
 
            if( !(p_current->p_meta->psz_title && *p_current->p_meta->psz_title
 
494
            /*if( !(p_current->p_meta->psz_title && *p_current->p_meta->psz_title
493
495
                && p_current->p_meta->psz_artist &&
494
496
                   *p_current->p_meta->psz_artist) )
495
 
            {
 
497
            {*/
 
498
                p.p_item = p_current;
 
499
                p.b_fetch_art = VLC_FALSE;
496
500
                vlc_mutex_lock( &p_playlist->p_secondary_preparse->object_lock);
497
 
                INSERT_ELEM( p_playlist->p_secondary_preparse->pp_waiting,
498
 
                             p_playlist->p_secondary_preparse->i_waiting,
499
 
                             p_playlist->p_secondary_preparse->i_waiting,
500
 
                             p_current );
 
501
                INSERT_ELEM( p_playlist->p_secondary_preparse->p_waiting,
 
502
                             p_playlist->p_secondary_preparse->i_waiting,
 
503
                             p_playlist->p_secondary_preparse->i_waiting,
 
504
                             p );
501
505
                vlc_mutex_unlock(
502
506
                            &p_playlist->p_secondary_preparse->object_lock);
503
 
            }
 
507
            /*}
504
508
            else
505
 
                vlc_gc_decref( p_current );
 
509
                vlc_gc_decref( p_current );*/
506
510
            PL_UNLOCK;
507
511
        }
508
512
        else
519
523
}
520
524
 
521
525
/** Main loop for secondary preparser queue */
522
 
void playlist_SecondaryPreparseLoop( playlist_preparse_t *p_obj )
 
526
void playlist_SecondaryPreparseLoop( playlist_secondary_preparse_t *p_obj )
523
527
{
524
528
    playlist_t *p_playlist = (playlist_t *)p_obj->p_parent;
525
529
 
527
531
 
528
532
    if( p_obj->i_waiting > 0 )
529
533
    {
530
 
        input_item_t *p_current = p_obj->pp_waiting[0];
531
 
        REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
 
534
        vlc_bool_t b_fetch_art = p_obj->p_waiting->b_fetch_art;
 
535
        input_item_t *p_item = p_obj->p_waiting->p_item;
 
536
        REMOVE_ELEM( p_obj->p_waiting, p_obj->i_waiting, 0 );
532
537
        vlc_mutex_unlock( &p_obj->object_lock );
533
 
        if( p_current )
 
538
        if( p_item )
534
539
        {
535
 
            input_MetaFetch( p_playlist, p_current );
536
 
            p_current->p_meta->i_status |= ITEM_META_FETCHED;
537
 
            var_SetInteger( p_playlist, "item-change", p_current->i_id );
538
 
            vlc_gc_decref( p_current );
 
540
            input_MetaFetch( p_playlist, p_item );
 
541
            p_item->p_meta->i_status |= ITEM_META_FETCHED;
 
542
            if( b_fetch_art == VLC_TRUE )
 
543
            {
 
544
                input_ArtFetch( p_playlist, p_item );
 
545
                p_item->p_meta->i_status |= ITEM_ART_FETCHED;
 
546
            }
 
547
            var_SetInteger( p_playlist, "item-change", p_item->i_id );
 
548
            vlc_gc_decref( p_item );
539
549
        }
540
550
        else
541
551
            PL_UNLOCK;