From b0ea3f42619d4d831830502f12340105937bf533 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Thu, 9 Feb 2012 23:54:31 +0100
Subject: playlist_save: add start/end_index parameters

---
 src/playlist_save.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'src/playlist_save.c')

diff --git a/src/playlist_save.c b/src/playlist_save.c
index b8e03ea85..6571e286c 100644
--- a/src/playlist_save.c
+++ b/src/playlist_save.c
@@ -112,7 +112,9 @@ spl_save_playlist(const char *name_utf8, const struct playlist *playlist)
 
 bool
 playlist_load_spl(struct playlist *playlist, struct player_control *pc,
-		  const char *name_utf8, GError **error_r)
+		  const char *name_utf8,
+		  unsigned start_index, unsigned end_index,
+		  GError **error_r)
 {
 	GPtrArray *list;
 
@@ -120,7 +122,10 @@ playlist_load_spl(struct playlist *playlist, struct player_control *pc,
 	if (list == NULL)
 		return false;
 
-	for (unsigned i = 0; i < list->len; ++i) {
+	if (list->len < end_index)
+		end_index = list->len;
+
+	for (unsigned i = start_index; i < end_index; ++i) {
 		const char *temp = g_ptr_array_index(list, i);
 		if ((playlist_append_uri(playlist, pc, temp, NULL)) != PLAYLIST_RESULT_SUCCESS) {
 			/* for windows compatibility, convert slashes */
-- 
cgit v1.2.3