Commit 41bf4c46 authored by Jakob Leben's avatar Jakob Leben

Playlist: fix faulty duration sorting due to integer overflow

close #3361
parent 86d3f7ad
......@@ -240,8 +240,11 @@ SORTFN( SORT_DESCRIPTION, first, second )
SORTFN( SORT_DURATION, first, second )
{
return input_item_GetDuration( first->p_input ) -
input_item_GetDuration( second->p_input );
mtime_t time1 = input_item_GetDuration( first->p_input );
mtime_t time2 = input_item_GetDuration( second->p_input );
int i_ret = time1 > time2 ? 1 :
( time1 == time2 ? 0 : -1 );
return i_ret;
}
SORTFN( SORT_GENRE, first, second )
......
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