p_playlist->p_preparse->i_waiting = 0;
p_playlist->p_preparse->pp_waiting = NULL;
- vlc_mutex_init( p_playlist->p_preparse,
- &p_playlist->p_preparse->object_lock );
vlc_object_attach( p_playlist->p_preparse, p_playlist );
if( vlc_thread_create( p_playlist->p_preparse, "preparser",
vlc_object_detach( p_playlist->p_preparse );
- vlc_mutex_destroy( &p_playlist->p_preparse->object_lock );
-
var_Destroy( p_playlist, "intf-change" );
var_Destroy( p_playlist, "item-change" );
var_Destroy( p_playlist, "playlist-current" );
/* Queue for items to preparse */
static void RunPreparse ( playlist_preparse_t *p_obj )
{
- playlist_t *p_playlist = p_obj->p_parent;
+ playlist_t *p_playlist = (playlist_t *)p_obj->p_parent;
vlc_bool_t b_sleep;
/* Tell above that we're ready */
input_Preparse( p_playlist, p_current );
var_SetInteger( p_playlist, "item-change", p_current->i_id );
vlc_mutex_lock( &p_obj->object_lock );
- fprintf(stderr, "END\n");
}
b_sleep = ( p_obj->i_waiting == 0 );
p_view = playlist_ViewFind( p_playlist,p_playlist->request.i_view );
p_playlist->status.p_node = p_playlist->request.p_node;
p_playlist->status.i_view = p_playlist->request.i_view;
- if( i_skip > 0 )
+ if( !p_view )
+ {
+ msg_Err( p_playlist, "p_view is NULL and should not! (FIXME)" );
+ }
+ else if( i_skip > 0 )
{
for( i = i_skip; i > 0 ; i-- )
{
p_view->p_root,
p_playlist->request.p_node,
p_new );
- if( p_new == NULL ) break;
+ if( p_new == NULL )
+ {
+ if( b_loop )
+ {
+ p_new = playlist_FindNextFromParent( p_playlist,
+ p_playlist->request.i_view,
+ p_view->p_root,
+ p_playlist->request.p_node,
+ NULL );
+ if( p_new == NULL ) break;
+ }
+ else
+ {
+ break;
+ }
+ }
}
}
else if( i_skip < 0 )
else
{
msg_Dbg( p_playlist,"finished" );
- p_new = NULL;
+ if( b_loop && p_playlist->i_size > 0)
+ {
+ p_playlist->i_index = 0;
+ p_new = p_playlist->pp_items[0];
+ }
+ else
+ p_new = NULL;
}
}
/* We are playing with a view */
playlist_view_t *p_view =
playlist_ViewFind( p_playlist,
p_playlist->status.i_view );
- fprintf(stderr,"Finding next of %s within %s, view %i\n",
- p_playlist->status.p_item ? p_playlist->status.p_item->input.psz_name : "coincoin",
- p_playlist->status.p_node->input.psz_name,
- p_playlist->status.i_view) ;
- p_new = playlist_FindNextFromParent( p_playlist,
+ if( !p_view )
+ {
+ msg_Err( p_playlist, "p_view is NULL and should not! (FIXME)" );
+ }
+ else
+ {
+ p_new = playlist_FindNextFromParent( p_playlist,
p_playlist->status.i_view,
p_view->p_root,
p_playlist->status.p_node,
p_playlist->status.p_item );
+ if( p_new == NULL && b_loop )
+ {
+ p_new = playlist_FindNextFromParent( p_playlist,
+ p_playlist->status.i_view,
+ p_view->p_root,
+ p_playlist->status.p_node,
+ NULL );
+ }
+ }
}
}
msg_Dbg(p_playlist,"next item found in "I64Fi " us", mdate()-start );
#endif
- if( p_new == NULL ) { msg_Info( p_playlist, "Nothing to play" ); }
-
+ if( p_new == NULL )
+ {
+ msg_Info( p_playlist, "Nothing to play" );
+ }
return p_new;
}
vlc_value_t oldval, vlc_value_t newval, void *param )
{
playlist_t *p_playlist = (playlist_t *)param;
- int i_index;
//p_playlist->b_need_update = VLC_TRUE;
var_SetInteger( p_playlist, "item-change", newval.i_int );
/* Update view */
/* FIXME: Make that automatic */
- playlist_ViewUpdate( p_playlist, VIEW_S_AUTHOR );
+// playlist_ViewUpdate( p_playlist, VIEW_S_AUTHOR );
return VLC_SUCCESS;
}