#include <vlc_art_finder.h>
#include <vlc_memory.h>
#include <vlc_demux.h>
+#include <vlc_modules.h>
#include "art.h"
#include "fetcher.h"
p_fetcher->i_waiting, p_item );
if( !p_fetcher->b_live )
{
- vlc_thread_t th;
-
- if( vlc_clone( &th, Thread, p_fetcher, VLC_THREAD_PRIORITY_LOW ) )
+ if( vlc_clone_detach( NULL, Thread, p_fetcher,
+ VLC_THREAD_PRIORITY_LOW ) )
msg_Err( p_fetcher->p_playlist,
"cannot spawn secondary preparse thread" );
else
- {
- vlc_detach( th );
p_fetcher->b_live = true;
- }
}
vlc_mutex_unlock( &p_fetcher->lock );
}
char *psz_arturl = input_item_GetArtURL( p_item );
if( psz_arturl )
{
- /* We already have an URL */
+ /* We already have a URL */
if( !strncmp( psz_arturl, "file://", strlen( "file://" ) ) )
{
free( psz_arturl );
{
module_t *p_module;
- vlc_object_attach( p_finder, p_parent );
p_finder->p_item = p_item;
p_module = module_need( p_finder, "art finder", NULL, false );
if( p_module )
{
module_unneed( p_finder, p_module );
- i_ret = 1;
+ /* Try immediately if found in cache by download URL */
+ if( !playlist_FindArtInCache( p_item ) )
+ i_ret = 0;
+ else
+ i_ret = 1;
}
vlc_object_release( p_finder );
}
if( !p_demux_meta )
return;
- vlc_object_attach( p_demux_meta, p_fetcher->p_playlist );
p_demux_meta->p_demux = NULL;
p_demux_meta->p_item = p_item;