Commit 6727d548 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

lib/media_list: simplify libvlc_media_list_index_of_item

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ec1bc03c
......@@ -442,15 +442,11 @@ libvlc_media_list_item_at_index( libvlc_media_list_t * p_mlist,
int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
libvlc_media_t * p_searched_md )
{
libvlc_media_t * p_md;
for ( int i = 0; i < vlc_array_count( &p_mlist->items ); i++ )
{
p_md = vlc_array_item_at_index( &p_mlist->items, i );
if( p_searched_md == p_md )
return i;
}
libvlc_printerr( "Media not found" );
return -1;
int idx = vlc_array_index_of_item( &p_mlist->items, p_searched_md );
if( idx == -1 )
libvlc_printerr( "Media not found" );
return idx;
}
/**************************************************************************
......
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