forked from len0rd/rockbox
Fix big WTF when closing the current track.
It must be set to something else valid (unless it's the only one left) when closing it, IN ALL CASES, not just if it's first or last. Don't know what was in my head. Hopefully takes care of a reported issue. Even if it's not causing any issues, it was still incorrect. Change-Id: I594af8b35d774ec222dadce80dfa8b95138f037e
This commit is contained in:
parent
c8564f1ca8
commit
02d20ebc25
1 changed files with 6 additions and 22 deletions
|
@ -611,38 +611,22 @@ static void track_list_free_buf_info(struct track_buf_info *tbip)
|
|||
return;
|
||||
}
|
||||
|
||||
/* If this one is the current track; new current track is next one,
|
||||
if any, else, the previous */
|
||||
if (hid == track_list.current_hid)
|
||||
track_list.current_hid = next_hid > 0 ? next_hid : prev_hid;
|
||||
|
||||
/* Fixup list links */
|
||||
if (prev_tbip)
|
||||
{
|
||||
prev_tbip->link[1] = next_hid;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Was the first track; new first track is next one */
|
||||
track_list.first_hid = next_hid;
|
||||
|
||||
if (hid == track_list.current_hid)
|
||||
{
|
||||
/* Was the current track; new current track is next one */
|
||||
track_list.current_hid = next_hid;
|
||||
}
|
||||
}
|
||||
|
||||
if (next_tbip)
|
||||
{
|
||||
next_tbip->link[0] = prev_hid;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Was the last track; new last track is previous one */
|
||||
track_list.last_hid = prev_hid;
|
||||
|
||||
if (hid == track_list.current_hid)
|
||||
{
|
||||
/* Was the current track; new current track is previous one */
|
||||
track_list.current_hid = prev_hid;
|
||||
}
|
||||
}
|
||||
|
||||
track_list.count--;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue