~videolan/vlc/old-trunk

« back to all changes in this revision

Viewing changes to src/playlist/engine.c

  • Committer: zorglub
  • Date: 2006-09-24 16:44:52 UTC
  • Revision ID: vcs-imports@canonical.com-20060924164452-67e1f15075c2847f
Start splitting the various meta module types
* meta reader : read directly from the file, should be made from the demux.
  Examples: taglib, id3tag
* meta fetcher : use web services to get meta, either from the current ones.
  Called only if we don't have the tags after using the meta readers
* art finder : find the URL of the suitable album art. Called according to the
  art policy
* art downloader : used to retrieve the art from special locations. Not needed
  if art is available directly from an URL.
  Examples: APIC ID3 tag reader

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 16822 2006-09-24 12:48:23Z zorglub $
 
5
 * $Id: engine.c 16834 2006-09-24 16:44:52Z zorglub $
6
6
 *
7
7
 * Authors: Samuel Hocevar <sam@zoy.org>
8
8
 *          Clément Stenac <zorglub@videolan.org>
482
482
                p_current->p_meta->i_status |= ITEM_PREPARSED;
483
483
                var_SetInteger( p_playlist, "item-change", p_current->i_id );
484
484
            }
485
 
            vlc_gc_decref( p_current );
486
 
            /* Add to secondary preparse queue */
487
 
            PL_LOCK
488
 
            vlc_mutex_lock( &p_playlist->p_secondary_preparse->object_lock );
489
 
            INSERT_ELEM( p_playlist->p_secondary_preparse->pp_waiting,
490
 
                         p_playlist->p_secondary_preparse->i_waiting,
491
 
                         p_playlist->p_secondary_preparse->i_waiting,
492
 
                         p_current );
493
 
            vlc_gc_incref( p_current );
494
 
            vlc_mutex_unlock( &p_playlist->p_secondary_preparse->object_lock );
495
 
            PL_UNLOCK
 
485
            PL_LOCK;
 
486
            /* We haven't retrieved enough meta, add to secondary queue
 
487
             * which will run the "meta fetchers"
 
488
             * TODO: - use i_mandatory stuff here instead of hardcoded T/A
 
489
             *       - don't do this for things we won't get meta for, like
 
490
             *         videos
 
491
             */
 
492
            if( !(p_current->p_meta->psz_title && *p_current->p_meta->psz_title
 
493
                && p_current->p_meta->psz_artist &&
 
494
                   *p_current->p_meta->psz_artist) )
 
495
            {
 
496
                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
                vlc_mutex_unlock(
 
502
                            &p_playlist->p_secondary_preparse->object_lock);
 
503
            }
 
504
            else
 
505
                vlc_gc_decref( p_current );
 
506
            PL_UNLOCK;
496
507
        }
497
508
        else
498
 
        {
499
 
            vlc_mutex_unlock( &p_playlist->object_lock );
500
 
        }
 
509
            PL_UNLOCK;
 
510
 
501
511
        vlc_mutex_lock( &p_obj->object_lock );
502
512
        i_activity = var_GetInteger( p_playlist, "activity" );
503
513
        if( i_activity < 0 ) i_activity = 0;