- vlc_gc_decref( p_current );
- /* Add to secondary preparse queue */
- PL_LOCK
- vlc_mutex_lock( &p_playlist->p_secondary_preparse->object_lock );
- INSERT_ELEM( p_playlist->p_secondary_preparse->pp_waiting,
- p_playlist->p_secondary_preparse->i_waiting,
- p_playlist->p_secondary_preparse->i_waiting,
- p_current );
- vlc_gc_incref( p_current );
- vlc_mutex_unlock( &p_playlist->p_secondary_preparse->object_lock );
- PL_UNLOCK
+ PL_LOCK;
+
+ /* If we haven't retrieved enough meta, add to secondary queue
+ * which will run the "meta fetchers".
+ * This only checks for meta, not for art
+ * \todo don't do this for things we won't get meta for, like vids
+ */
+ if( p_current->p_meta &&
+ !input_MetaSatisfied( p_playlist, p_current, &i_m, &i_o ) )
+ {
+ preparse_item_t p;
+ PL_DEBUG("need to fetch meta for %s", p_current->psz_name );
+ p.p_item = p_current;
+ p.b_fetch_art = VLC_FALSE;
+ vlc_mutex_lock( &p_playlist->p_fetcher->object_lock );
+ INSERT_ELEM( p_playlist->p_fetcher->p_waiting,
+ p_playlist->p_fetcher->i_waiting,
+ p_playlist->p_fetcher->i_waiting, p);
+ vlc_mutex_unlock( &p_playlist->p_fetcher->object_lock );
+ vlc_cond_signal( &p_playlist->p_fetcher->object_wait );
+ }
+ /* We already have all needed meta, but we need art right now */
+ else if( p_current->p_meta &&
+ p_playlist->p_fetcher->i_art_policy == ALBUM_ART_ALL &&
+ EMPTY_STR( p_current->p_meta->psz_arturl ) )
+ {
+ preparse_item_t p;
+ PL_DEBUG("meta ok for %s, need to fetch art",
+ p_current->psz_name );
+ p.p_item = p_current;
+ p.b_fetch_art = VLC_TRUE;
+ vlc_mutex_lock( &p_playlist->p_fetcher->object_lock );
+ INSERT_ELEM( p_playlist->p_fetcher->p_waiting,
+ p_playlist->p_fetcher->i_waiting,
+ p_playlist->p_fetcher->i_waiting, p);
+ vlc_mutex_unlock( &p_playlist->p_fetcher->object_lock );
+ vlc_cond_signal( &p_playlist->p_fetcher->object_wait );
+ }
+ else
+ {
+ PL_DEBUG( "no fetch required for %s (art currently %s)",
+ p_current->psz_name,
+ p_current->p_meta ? p_current->p_meta->psz_arturl:
+ "null" );
+ vlc_gc_decref( p_current );
+ }
+ PL_UNLOCK;