src/playlist/item-ext.c: fixed a recent bug in playlist_ItemGetById

parent df15918b
......@@ -464,7 +464,7 @@ playlist_item_t * playlist_ItemGetById( playlist_t * p_playlist , int i_id )
i_bottom = 0; i_top = p_playlist->i_all_size;
i = i_top / 2;
while( p_playlist->pp_all_items[i]->input.i_id != i_id &&
i_top > i_bottom )
i_top > i_bottom + 1 )
{
if( p_playlist->pp_all_items[i]->input.i_id < i_id )
{
......@@ -480,6 +480,11 @@ playlist_item_t * playlist_ItemGetById( playlist_t * p_playlist , int i_id )
{
return p_playlist->pp_all_items[i];
}
else if( p_playlist->pp_all_items[i_top]->input.i_id == i_id )
{
return p_playlist->pp_all_items[i_top];
}
return NULL;
}
......
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