Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Playlists
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 2
  • Private
Attached to Project: Rockbox
Opened by cc - 2007-10-07
Last edited by kugel. - 2009-10-16

FS#7898 - Fix for bug in "Insert Next" with multiple insertions

This patch fixes a bug: When using “Insert Next” to insert multiple files to a playlist, last_insert_pos only gets updated for the first file inserted, so a subsequent “Insert” inserts in the wrong position.

Eg: Insert 1 2 3, Insert Next 4 5 6, Insert 7 8 9 gives:

1 4 7 8 9 5 6 2 3

Instead of

1 4 5 6 7 8 9 2 3

The problem is that for “Insert Next” the directory_search_callback function keeps track of the insert position and add_track_to_playlist does not update last_insert_pos when called with a specific insert position ahead of the last_insert_pos.

This patch works by not keeping track of the insert position in directory_search_callback and instead just switching to “Insert” mode after the first file is inserted - which makes sure the next file gets put in the right place (after the first file) and that last_insert_pos gets updated correctly.

The patch also fixes the same problem when inserting a playlist with “Insert next”.

Closed by  kugel.
2009-10-16 22:15
Reason for closing:  Out of Date
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

Should work fine nowadays.

dunno commented on 2007-10-12 08:07

I asked the devs in irc to look at this patch and 7911, they voiced objections to both patches, 7898 and 7911, would you mind popping in to irc and chatting to them about their issues, perhaps it might speed up the incorporation of the patches to svn.

Many Thanks.

cc commented on 2007-10-12 12:40

OK, while I’m waiting on irc - maybe I should point out that in my examples I am talking about inserting directories (each containing 3 files). Also during the insertions song 1 is playing.

So after doing “insert next” of a directory containing 4 5 6 the playlist is:
1 4 5 6 2 3

Then doing an “Insert” (song 1 is still playing) inserts after 4 - so the initial “Insert Next” does move the position where the “Insert” occurs (otherwise it would have inserted after 1), but not to after the last track inserted.

Another possibility is that the “Insert Next” should not move the pointer ever (that is one interpretation of what the manual says at the moment) - but this is not what happens when inserting single tracks, and I think would be more confusing.

cc commented on 2007-10-20 09:41

I was searching for something else and found this bug, which I think is the same problem that this
patch fixes:
http://www.rockbox.org/tracker/7363

My apologies for not finding it before I started this task.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing