summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playlist.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 133820ebc4..fd34cbe0cf 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -783,15 +783,16 @@ static int add_track_to_playlist(struct playlist_info* playlist,
783 } 783 }
784 784
785 /* update stored indices if needed */ 785 /* update stored indices if needed */
786 if (playlist->amount > 0 && insert_position <= playlist->index &&
787 playlist->started)
788 playlist->index++;
789 786
790 if (playlist->amount > 0 && insert_position <= playlist->first_index && 787 if (orig_position < 0)
791 orig_position != PLAYLIST_PREPEND && playlist->started)
792 { 788 {
793 playlist->first_index++; 789 if (playlist->amount > 0 && insert_position <= playlist->index &&
790 playlist->started)
791 playlist->index++;
794 792
793 if (playlist->amount > 0 && insert_position <= playlist->first_index &&
794 orig_position != PLAYLIST_PREPEND && playlist->started)
795 playlist->first_index++;
795 } 796 }
796 797
797 if (insert_position < playlist->last_insert_pos || 798 if (insert_position < playlist->last_insert_pos ||