diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-09-18 20:47:27 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-09-18 20:47:27 +0000 |
commit | 10ad0a2a942f0dc2a31374135440c25a1a4f05bb (patch) | |
tree | ccab2cf9ca17b7fe65d16acb16b14bdcf5ed55cd /apps/playlist.c | |
parent | 9fe9cdff358046374ab0ed3240581e98bc63b1db (diff) | |
download | rockbox-10ad0a2a942f0dc2a31374135440c25a1a4f05bb.tar.gz rockbox-10ad0a2a942f0dc2a31374135440c25a1a4f05bb.zip |
Fixed problem with first_index being incorrectly updated when prepending tracks. Fixes example 1 in B#6005.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10996 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 4ab98ab3c6..6648d4462e 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -571,10 +571,12 @@ static int add_track_to_playlist(struct playlist_info* playlist, | |||
571 | const char *filename, int position, | 571 | const char *filename, int position, |
572 | bool queue, int seek_pos) | 572 | bool queue, int seek_pos) |
573 | { | 573 | { |
574 | int insert_position = position; | 574 | int insert_position, orig_position; |
575 | unsigned long flags = PLAYLIST_INSERT_TYPE_INSERT; | 575 | unsigned long flags = PLAYLIST_INSERT_TYPE_INSERT; |
576 | int i; | 576 | int i; |
577 | 577 | ||
578 | insert_position = orig_position = position; | ||
579 | |||
578 | if (playlist->amount >= playlist->max_playlist_size) | 580 | if (playlist->amount >= playlist->max_playlist_size) |
579 | { | 581 | { |
580 | display_buffer_full(); | 582 | display_buffer_full(); |
@@ -661,7 +663,7 @@ static int add_track_to_playlist(struct playlist_info* playlist, | |||
661 | playlist->index++; | 663 | playlist->index++; |
662 | 664 | ||
663 | if (playlist->amount > 0 && insert_position <= playlist->first_index && | 665 | if (playlist->amount > 0 && insert_position <= playlist->first_index && |
664 | position != PLAYLIST_PREPEND && playlist->started) | 666 | orig_position != PLAYLIST_PREPEND && playlist->started) |
665 | { | 667 | { |
666 | playlist->first_index++; | 668 | playlist->first_index++; |
667 | 669 | ||