Commit 82a358ac authored by Rafaël Carré's avatar Rafaël Carré

Fix #1487 - race condition

parent ce7d502e
...@@ -437,6 +437,7 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist ) ...@@ -437,6 +437,7 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
p_playlist->status.p_item ); p_playlist->status.p_item );
p_playlist->i_current_index++; p_playlist->i_current_index++;
assert( p_playlist->i_current_index <= p_playlist->current.i_size );
if( p_playlist->i_current_index == p_playlist->current.i_size ) if( p_playlist->i_current_index == p_playlist->current.i_size )
{ {
if( !b_loop || p_playlist->current.i_size == 0 ) return NULL; if( !b_loop || p_playlist->current.i_size == 0 ) return NULL;
......
...@@ -352,7 +352,9 @@ check_input: ...@@ -352,7 +352,9 @@ check_input:
* - Request, running requested -> start new item * - Request, running requested -> start new item
* - Request, stopped requested -> collect garbage * - Request, stopped requested -> collect garbage
*/ */
if( p_playlist->request.i_status != PLAYLIST_STOPPED ) int i_status = p_playlist->request.b_request ?
p_playlist->request.i_status : p_playlist->status.i_status;
if( i_status != PLAYLIST_STOPPED )
{ {
msg_Dbg( p_playlist, "starting new item" ); msg_Dbg( p_playlist, "starting new item" );
p_item = playlist_NextItem( p_playlist ); p_item = playlist_NextItem( p_playlist );
......
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