This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10288 - Resume after "Insert Shuffled" incorrect.
Attached to Project:
Rockbox
Opened by Paul Louden (Llorean) - Saturday, 06 June 2009, 20:17 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Thursday, 21 January 2010, 08:28 GMT+2
Opened by Paul Louden (Llorean) - Saturday, 06 June 2009, 20:17 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Thursday, 21 January 2010, 08:28 GMT+2
|
DetailsThis one's easy to reproduce. With music stopped, do "Insert Shuffled" on a folder. You're in playlist position 1 at this point (first song out of however many you just inserted). Stop playback. Resume playback. You'll be in the same song, but it will now be in an entirely different location in the playlist.
Still occurs as of 21199 |
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Thursday, 21 January 2010, 08:28 GMT+2
Reason for closing: Accepted
Additional comments about closing: thanks! in r24303.
Thursday, 21 January 2010, 08:28 GMT+2
Reason for closing: Accepted
Additional comments about closing: thanks! in r24303.
guarenteed repro:
stop playback, "insert shuffled" on a folder. not the playlist order. stop playback, resume playback, not the order.
recreating the playlist by hand from the .playlist_control gives me the correct order (unsurprising really) which means I think the issue is that the files arnt being inserted where the playlist_control thinks they are.
edit: well creation looks correct also :(
Other observation based on inserting directory with 3 songs and .playlist_control |position| value after directory insertion:
000, 001, 010, 002 - error after playback stop
011, 012 - everything ok
It's looks like error happens only when any song is inserted before first song in playlist.
Is there any .doc about playlist concept and implementation? I've found only few lines in playlist.c but nothing in deep.
Can playlist->index and playlist->first_index have negative value?
I dont think there is any docs for this, its all pretty old code :/
I *think* playlist->index is the index of the current tack, and first_index is the index of the first track in the playlist. neither should be <0 if thats correct.
1. turn on sim/device
2. insert_shuffled directory
3. Take a look at: Main_Menu->Playlists->View_Current_Playlist - everything is ok and in line with .playlist_control content
4. Turn back to Main_Menu->Playlists
5. Stop playback pressing Home for fuze/fuze sim or something else for other players
6. Again take a look at: Main_Menu->Playlists->View_Current_Playlist - you will see rolled playlist not in sync with .playlist_control
I agree with playlist->index and first index meaning but concerning negative values i found following code
playlist.c
797 : if (insert_position < playlist->last_insert_pos ||
798 : (insert_position == playlist->last_insert_pos && position < 0))
799 : playlist->last_insert_pos++;
Position can be negative?
position can be negative (PLAYLIST_INSERT* are defined to negative values)