aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/playlist_state.c4
-rw-r--r--src/queue_save.c9
-rw-r--r--src/queue_save.h5
3 files changed, 7 insertions, 11 deletions
diff --git a/src/playlist_state.c b/src/playlist_state.c
index d62aa3f85..b0f99dd05 100644
--- a/src/playlist_state.c
+++ b/src/playlist_state.c
@@ -101,8 +101,6 @@ playlist_state_save(FILE *fp, const struct playlist *playlist)
static void
playlist_state_load(FILE *fp, GString *buffer, struct playlist *playlist)
{
- int song;
-
const char *line = read_text_line(fp, buffer);
if (line == NULL) {
g_warning("No playlist in state file");
@@ -110,7 +108,7 @@ playlist_state_load(FILE *fp, GString *buffer, struct playlist *playlist)
}
while (!g_str_has_prefix(line, PLAYLIST_STATE_FILE_PLAYLIST_END)) {
- song = queue_load_song(&playlist->queue, line);
+ queue_load_song(&playlist->queue, line);
line = read_text_line(fp, buffer);
if (line == NULL) {
diff --git a/src/queue_save.c b/src/queue_save.c
index 4eb095a59..69ef483b3 100644
--- a/src/queue_save.c
+++ b/src/queue_save.c
@@ -53,7 +53,7 @@ get_song(const char *uri)
return NULL;
}
-int
+void
queue_load_song(struct queue *queue, const char *line)
{
long ret;
@@ -61,20 +61,19 @@ queue_load_song(struct queue *queue, const char *line)
struct song *song;
if (queue_is_full(queue))
- return -1;
+ return;
ret = strtol(line, &endptr, 10);
if (ret < 0 || *endptr != ':' || endptr[1] == 0) {
g_warning("Malformed playlist line in state file");
- return -1;
+ return;
}
line = endptr + 1;
song = get_song(line);
if (song == NULL)
- return -1;
+ return;
queue_append(queue, song);
- return ret;
}
diff --git a/src/queue_save.h b/src/queue_save.h
index 472f46329..a3372c1f2 100644
--- a/src/queue_save.h
+++ b/src/queue_save.h
@@ -33,10 +33,9 @@ void
queue_save(FILE *fp, const struct queue *queue);
/**
- * Loads one song from the state file line and returns its number.
- * Returns -1 on failure.
+ * Loads one song from the state file and appends it to the queue.
*/
-int
+void
queue_load_song(struct queue *queue, const char *line);
#endif