Commit 698c1a3d authored by Antoine Cellerier's avatar Antoine Cellerier

add new playlist_PreparseEnqueueItem function which preparses a playlist_item

and all its children.
parent 64595f0c
......@@ -261,6 +261,7 @@ VLC_EXPORT( int, playlist_Clear, ( playlist_t * ) );
VLC_EXPORT( int, playlist_LockClear, ( playlist_t * ) );
VLC_EXPORT( int, playlist_PreparseEnqueue, (playlist_t *, input_item_t *) );
VLC_EXPORT( int, playlist_PreparseEnqueueItem, (playlist_t *, playlist_item_t *) );
/* Services discovery */
......
......@@ -416,6 +416,7 @@ struct module_symbols_t
const char * (*VLC_CompileHost_inner) (void);
const char * (*VLC_Version_inner) (void);
const char * (*VLC_CompileTime_inner) (void);
int (*playlist_PreparseEnqueueItem_inner) (playlist_t *, playlist_item_t *);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
......@@ -814,6 +815,7 @@ struct module_symbols_t
# define VLC_CompileHost (p_symbols)->VLC_CompileHost_inner
# define VLC_Version (p_symbols)->VLC_Version_inner
# define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner
# define playlist_PreparseEnqueueItem (p_symbols)->playlist_PreparseEnqueueItem_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
......@@ -1215,6 +1217,7 @@ struct module_symbols_t
((p_symbols)->VLC_CompileHost_inner) = VLC_CompileHost; \
((p_symbols)->VLC_Version_inner) = VLC_Version; \
((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \
((p_symbols)->playlist_PreparseEnqueueItem_inner) = playlist_PreparseEnqueueItem; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \
(p_symbols)->__osd_VolumeDown_deprecated = NULL; \
......
......@@ -52,6 +52,8 @@ static int ItemChange( vlc_object_t *, const char *,
int playlist_vaControl( playlist_t * p_playlist, int i_query, va_list args );
void playlist_PreparseEnqueueItemSub( playlist_t *, playlist_item_t * );
/**
* Create playlist
......@@ -450,6 +452,39 @@ int playlist_PreparseEnqueue( playlist_t *p_playlist,
return VLC_SUCCESS;
}
/* Should only be called if playlist and preparser are locked */
void playlist_PreparseEnqueueItemSub( playlist_t *p_playlist,
playlist_item_t *p_item )
{
int i;
if( p_item->i_children == -1 )
{
INSERT_ELEM( p_playlist->p_preparse->pp_waiting,
p_playlist->p_preparse->i_waiting,
p_playlist->p_preparse->i_waiting,
&(p_item->input) );
}
else
{
for( i = 0; i < p_item->i_children; i++)
{
playlist_PreparseEnqueueItemSub( p_playlist,
p_item->pp_children[i] );
}
}
}
int playlist_PreparseEnqueueItem( playlist_t *p_playlist,
playlist_item_t *p_item )
{
vlc_mutex_lock( &p_playlist->object_lock );
vlc_mutex_lock( &p_playlist->p_preparse->object_lock );
playlist_PreparseEnqueueItemSub( p_playlist, p_item );
vlc_mutex_unlock( &p_playlist->p_preparse->object_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
return VLC_SUCCESS;
}
/* Destroy remaining objects */
static mtime_t ObjectGarbageCollector( playlist_t *p_playlist, int i_type,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment