int i_options, char **ppsz_options,
libvlc_exception_t *p_e )
{
- VLC_UNUSED(p_e);
+ VLC_UNUSED(p_e); VLC_UNUSED(i_options); VLC_UNUSED(ppsz_options);
int did_lock = 0;
assert( PL );
if (! playlist_was_locked( p_instance ) )
{
playlist_mark_locked( p_instance, 1 );
- vlc_mutex_lock( &PL->object_lock );
+ vlc_object_lock( PL );
did_lock = 1;
}
{
if( did_lock == 1 )
{
- vlc_mutex_unlock( &PL->object_lock );
+ vlc_object_unlock( PL );
playlist_mark_locked( p_instance, 0 );
}
RAISEVOID( "Unable to find item" );
}
- playlist_Control( PL, PLAYLIST_VIEWPLAY, true,
+ playlist_Control( PL, PLAYLIST_VIEWPLAY, pl_Locked,
PL->status.p_node, p_item );
if( did_lock == 1 )
{
- vlc_mutex_unlock( &PL->object_lock );
+ vlc_object_unlock( PL );
playlist_mark_locked( p_instance, 0 );
}
}
}
return playlist_AddExt( PL, psz_uri, psz_name,
PLAYLIST_INSERT, PLAYLIST_END, -1, ppsz_options,
- i_options, 1, false );
+ i_options, 1, pl_Unlocked );
}
return playlist_CurrentSize( PL );
}
+int libvlc_playlist_get_current_index ( libvlc_instance_t *p_instance,
+ libvlc_exception_t *p_e )
+{
+ VLC_UNUSED(p_e);
+
+ assert( PL );
+ if( !PL->status.p_item )
+ return -1;
+ return playlist_CurrentId( PL );
+}
+
void libvlc_playlist_lock( libvlc_instance_t *p_instance )
{
assert( PL );
- vlc_mutex_lock( &PL->object_lock );
+ vlc_object_lock( PL );
p_instance->b_playlist_locked = 1;
}
{
assert( PL );
p_instance->b_playlist_locked = 0;
- vlc_mutex_unlock( &PL->object_lock );
+ vlc_object_unlock( PL );
}
libvlc_media_player_t * libvlc_playlist_get_media_player(
libvlc_media_player_t *p_mi;
assert( PL );
- vlc_mutex_lock( &PL->object_lock );
+ vlc_object_lock( PL );
if( PL->p_input )
{
p_mi = libvlc_media_player_new_from_input_thread(
p_mi = NULL;
libvlc_exception_raise( p_e, "No active input" );
}
- vlc_mutex_unlock( &PL->object_lock );
+ vlc_object_unlock( PL );
return p_mi;
}