Commit 919efd8e authored by Clément Stenac's avatar Clément Stenac

Merge [11470],[11471],[11474] and [11475] - Closes: #205

parent be421631
...@@ -367,6 +367,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -367,6 +367,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
if ( p_temp_item ) if ( p_temp_item )
{ {
vlc_mutex_lock( &p_playlist->object_lock );
while( p_temp_item->i_parents > 0 ) while( p_temp_item->i_parents > 0 )
{ {
int i; int i;
...@@ -377,6 +378,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -377,6 +378,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
if( p_temp_item->pp_parents[i]->p_parent == p_node ) if( p_temp_item->pp_parents[i]->p_parent == p_node )
{ {
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
vlc_mutex_unlock( &p_playlist->object_lock );
return YES; return YES;
} }
else else
...@@ -387,6 +389,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -387,6 +389,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
} }
} }
vlc_mutex_unlock( &p_playlist->object_lock );
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
......
...@@ -622,6 +622,7 @@ int playlist_Replace( playlist_t *p_playlist, playlist_item_t *p_olditem, ...@@ -622,6 +622,7 @@ int playlist_Replace( playlist_t *p_playlist, playlist_item_t *p_olditem,
int playlist_Delete( playlist_t * p_playlist, int i_id ) int playlist_Delete( playlist_t * p_playlist, int i_id )
{ {
int i, i_top, i_bottom; int i, i_top, i_bottom;
int i_pos;
vlc_bool_t b_flag = VLC_FALSE; vlc_bool_t b_flag = VLC_FALSE;
playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id ); playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id );
...@@ -663,10 +664,19 @@ int playlist_Delete( playlist_t * p_playlist, int i_id ) ...@@ -663,10 +664,19 @@ int playlist_Delete( playlist_t * p_playlist, int i_id )
/* Hack we don't call playlist_Control for lock reasons */ /* Hack we don't call playlist_Control for lock reasons */
p_playlist->status.i_status = PLAYLIST_STOPPED; p_playlist->status.i_status = PLAYLIST_STOPPED;
p_playlist->request.b_request = VLC_TRUE; p_playlist->request.b_request = VLC_TRUE;
p_playlist->request.p_item = NULL;
msg_Info( p_playlist, "stopping playback" ); msg_Info( p_playlist, "stopping playback" );
b_flag = VLC_TRUE; b_flag = VLC_TRUE;
} }
/* Get position and update index if needed */
i_pos = playlist_GetPositionById( p_playlist, i_id );
if( i_pos >= 0 && i_pos <= p_playlist->i_index )
{
p_playlist->i_index--;
}
msg_Dbg( p_playlist, "deleting playlist item `%s'", msg_Dbg( p_playlist, "deleting playlist item `%s'",
p_item->input.psz_name ); p_item->input.psz_name );
......
...@@ -332,7 +332,8 @@ int playlist_vaControl( playlist_t * p_playlist, int i_query, va_list args ) ...@@ -332,7 +332,8 @@ int playlist_vaControl( playlist_t * p_playlist, int i_query, va_list args )
i_view = (int)va_arg( args,int ); i_view = (int)va_arg( args,int );
p_node = (playlist_item_t *)va_arg( args, playlist_item_t * ); p_node = (playlist_item_t *)va_arg( args, playlist_item_t * );
p_item = (playlist_item_t *)va_arg( args, playlist_item_t * ); p_item = (playlist_item_t *)va_arg( args, playlist_item_t * );
if ( p_node == NULL || p_item == NULL || p_item->input.psz_uri == NULL ) if ( p_node == NULL || (p_item != NULL && p_item->input.psz_uri
== NULL ))
{ {
p_playlist->status.i_status = PLAYLIST_STOPPED; p_playlist->status.i_status = PLAYLIST_STOPPED;
p_playlist->request.b_request = VLC_TRUE; p_playlist->request.b_request = VLC_TRUE;
...@@ -866,7 +867,7 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -866,7 +867,7 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
i_skip = p_playlist->request.i_skip; i_skip = p_playlist->request.i_skip;
i_goto = p_playlist->request.i_goto; i_goto = p_playlist->request.i_goto;
if( p_playlist->i_index == -1 ) p_playlist->i_index = 0; if( p_playlist->i_index < 0 ) p_playlist->i_index = 0;
p_new = p_playlist->pp_items[p_playlist->i_index]; p_new = p_playlist->pp_items[p_playlist->i_index];
if( i_goto >= 0 && i_goto < p_playlist->i_size ) if( i_goto >= 0 && i_goto < p_playlist->i_size )
......
...@@ -619,6 +619,8 @@ playlist_item_t *playlist_FindNextFromParent( playlist_t *p_playlist, ...@@ -619,6 +619,8 @@ playlist_item_t *playlist_FindNextFromParent( playlist_t *p_playlist,
{ {
msg_Dbg( p_playlist, "finding something to play within %s -root %s", msg_Dbg( p_playlist, "finding something to play within %s -root %s",
p_node->input.psz_name, p_root->input.psz_name ); p_node->input.psz_name, p_root->input.psz_name );
msg_Dbg( p_playlist, "%s has %i children",
p_node->input.psz_name, p_node->i_children );
} }
#endif #endif
......
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