If the item is not to be preparsed but has enough meta, mark it as preparsed
15 files changed:
#define PLAYLIST_APPEND 0x0002
#define PLAYLIST_GO 0x0004
#define PLAYLIST_PREPARSE 0x0008
#define PLAYLIST_APPEND 0x0002
#define PLAYLIST_GO 0x0004
#define PLAYLIST_PREPARSE 0x0008
+#define PLAYLIST_SPREPARSE 0x0010
#define PLAYLIST_END -666
#define PLAYLIST_END -666
vlc_bool_t b_doing_ml; /**< Doing media library stuff, */
/*get quicker */
vlc_bool_t b_doing_ml; /**< Doing media library stuff, */
/*get quicker */
+ vlc_bool_t b_auto_preparse;
/* Runtime */
input_thread_t * p_input; /**< the input thread associated
/* Runtime */
input_thread_t * p_input; /**< the input thread associated
input_ItemCopyOptions( p_current->p_input, p_input );
playlist_BothAddInput( p_playlist, p_input,
p_item_in_category,
input_ItemCopyOptions( p_current->p_input, p_input );
playlist_BothAddInput( p_playlist, p_input,
p_item_in_category,
- PLAYLIST_APPEND,
- PLAYLIST_END );
+ PLAYLIST_APPEND|PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
free( psz_string );
}
else continue;
free( psz_string );
}
else continue;
if( psz_abstract_entry ) vlc_meta_SetDescription( p_entry->p_meta, psz_abstract_entry );
playlist_BothAddInput( p_playlist, p_entry,
p_item_in_category,
if( psz_abstract_entry ) vlc_meta_SetDescription( p_entry->p_meta, psz_abstract_entry );
playlist_BothAddInput( p_playlist, p_entry,
p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END);
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE
+ , PLAYLIST_END);
free( psz_string );
}
else continue;
free( psz_string );
}
else continue;
playlist_BothAddInput( p_playlist, p_input,
p_item_in_category,
playlist_BothAddInput( p_playlist, p_input,
p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
FREENULL( psz_name );
FREENULL( psz_mrl );
FREENULL( psz_genre );
FREENULL( psz_name );
FREENULL( psz_mrl );
FREENULL( psz_genre );
input_ItemAddOption( p_input, ppsz_options[i] );
}
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
input_ItemAddOption( p_input, ppsz_options[i] );
}
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
while( i_options-- ) free( ppsz_options[i_options] );
if( ppsz_options ) free( ppsz_options );
while( i_options-- ) free( ppsz_options[i_options] );
if( ppsz_options ) free( ppsz_options );
SADD_INFO( "description", psz_description );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
SADD_INFO( "description", psz_description );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
}
HANDLE_PLAY_AND_RELEASE;
}
HANDLE_PLAY_AND_RELEASE;
input_ItemAddInfo( p_input, _(VLC_META_INFO_CAT),
_(VLC_META_ARTIST), "%s", psz_artist );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
input_ItemAddInfo( p_input, _(VLC_META_INFO_CAT),
_(VLC_META_ARTIST), "%s", psz_artist );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
0, NULL, -1 );
input_ItemCopyOptions( p_current->p_input, p_input );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
0, NULL, -1 );
input_ItemCopyOptions( p_current->p_input, p_input );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,0, NULL, -1 );
input_ItemCopyOptions( p_current->p_input, p_input );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,0, NULL, -1 );
input_ItemCopyOptions( p_current->p_input, p_input );
playlist_BothAddInput( p_playlist, p_input, p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
free( psz_mrl_orig );
psz_mrl = NULL;
}
free( psz_mrl_orig );
psz_mrl = NULL;
}
}
playlist_BothAddInput( p_playlist, p_input,
p_item_in_category,
}
playlist_BothAddInput( p_playlist, p_input,
p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE
+ , PLAYLIST_END );
FREENULL( psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_size );
FREENULL( psz_item_name );
FREENULL( psz_item_mrl );
FREENULL( psz_item_size );
SADD_INFO( "href", psz_href );
SADD_INFO( "mime type", psz_mimetype );
playlist_BothAddInput( p_sys->p_playlist, p_input,
SADD_INFO( "href", psz_href );
SADD_INFO( "mime type", psz_mimetype );
playlist_BothAddInput( p_sys->p_playlist, p_input,
- p_sys->p_item_in_category, PLAYLIST_APPEND,
+ p_sys->p_item_in_category,
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
PLAYLIST_END );
if( psz_qtnext )
{
PLAYLIST_END );
if( psz_qtnext )
{
psz_qtnext, NULL, 0, NULL, -1 );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
psz_qtnext, NULL, 0, NULL, -1 );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
}
playlist_BothAddInput( p_playlist, p_child, p_item_in_category,
}
playlist_BothAddInput( p_playlist, p_child, p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE, PLAYLIST_END );
HANDLE_PLAY_AND_RELEASE
return -1; /* Needed for correct operation of go back */
}
HANDLE_PLAY_AND_RELEASE
return -1; /* Needed for correct operation of go back */
}
free( psz_mrl );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
free( psz_mrl );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
FREENULL( psz_name );
}
FREENULL( psz_eltname );
FREENULL( psz_name );
}
FREENULL( psz_eltname );
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
playlist_BothAddInput( p_sys->p_playlist, p_input,
p_sys->p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
FREENULL( psz_name );
FREENULL( psz_mt )
FREENULL( psz_name );
FREENULL( psz_mt )
FREE_ATT();
playlist_BothAddInput( p_playlist, p_new_input,
p_demux->p_sys->p_item_in_category,
FREE_ATT();
playlist_BothAddInput( p_playlist, p_new_input,
p_demux->p_sys->p_item_in_category,
- PLAYLIST_APPEND, PLAYLIST_END );
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE,
+ PLAYLIST_END );
if( p_demux->p_sys->i_identifier <
p_demux->p_sys->i_tracklist_entries )
{
if( p_demux->p_sys->i_identifier <
p_demux->p_sys->i_tracklist_entries )
{
playlist_t * playlist_Create( vlc_object_t *p_parent )
{
playlist_t *p_playlist;
playlist_t * playlist_Create( vlc_object_t *p_parent )
{
playlist_t *p_playlist;
int i_tree;
/* Allocate structure */
int i_tree;
/* Allocate structure */
p_playlist->b_doing_ml = VLC_FALSE;
p_playlist->b_doing_ml = VLC_FALSE;
+ p_playlist->b_auto_preparse =
+ var_CreateGetBool( p_playlist, "auto-preparse") ;
+
p_playlist->p_root_category = playlist_NodeCreate( p_playlist, NULL, NULL);
p_playlist->p_root_onelevel = playlist_NodeCreate( p_playlist, NULL, NULL);
p_playlist->p_root_category = playlist_NodeCreate( p_playlist, NULL, NULL);
p_playlist->p_root_onelevel = playlist_NodeCreate( p_playlist, NULL, NULL);
p_playlist->i_order = ORDER_NORMAL;
vlc_object_attach( p_playlist, p_parent );
p_playlist->i_order = ORDER_NORMAL;
vlc_object_attach( p_playlist, p_parent );
+ b_save = p_playlist->b_auto_preparse;
+ p_playlist->b_auto_preparse = VLC_FALSE;
playlist_MLLoad( p_playlist );
playlist_MLLoad( p_playlist );
+ p_playlist->b_auto_preparse = VLC_TRUE;
p_playlist->request.i_status = PLAYLIST_RUNNING;
vlc_cond_signal( &p_playlist->object_wait );
}
p_playlist->request.i_status = PLAYLIST_RUNNING;
vlc_cond_signal( &p_playlist->object_wait );
}
- if( i_mode & PLAYLIST_PREPARSE &&
- var_CreateGetBool( p_playlist, "auto-preparse" ) )
- {
+ /* Preparse if PREPARSE or SPREPARSE & not enough meta */
+ if( p_playlist->b_auto_preparse &&
+ (i_mode & PLAYLIST_PREPARSE ||
+ ( i_mode & PLAYLIST_SPREPARSE &&
+ ( !p_item_cat->p_input->p_meta || (p_item_cat->p_input->p_meta &&
+ ( EMPTY_STR( p_item_cat->p_input->p_meta->psz_artist ) ||
+ EMPTY_STR( p_item_cat->p_input->p_meta->psz_album ) )
+ )
+ )
+ ) ) )
playlist_PreparseEnqueue( p_playlist, p_item_cat->p_input );
playlist_PreparseEnqueue( p_playlist, p_item_cat->p_input );
+ /* If we already have it, signal it */
+ else if( p_item_cat->p_input->p_meta &&
+ !EMPTY_STR( p_item_cat->p_input->p_meta->psz_artist ) &&
+ !EMPTY_STR( p_item_cat->p_input->p_meta->psz_album ) )
+ p_item_cat->p_input->p_meta->i_status = ITEM_PREPARSED;
}
/* Add the playlist item to the requested node and fire a notification */
}
/* Add the playlist item to the requested node and fire a notification */