aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/playlist.c b/src/playlist.c
index dc6d8c340..71abcb692 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -78,14 +78,15 @@ static void
playlist_queue_song_order(struct playlist *playlist, struct player_control *pc,
unsigned order)
{
- struct song *song;
char *uri;
assert(queue_valid_order(&playlist->queue, order));
playlist->queued = order;
- song = queue_get_order(&playlist->queue, order);
+ struct song *song =
+ song_dup_detached(queue_get_order(&playlist->queue, order));
+
uri = song_get_uri(song);
g_debug("queue song %i:\"%s\"", playlist->queued, uri);
g_free(uri);
@@ -186,13 +187,13 @@ void
playlist_play_order(struct playlist *playlist, struct player_control *pc,
int orderNum)
{
- struct song *song;
char *uri;
playlist->playing = true;
playlist->queued = -1;
- song = queue_get_order(&playlist->queue, orderNum);
+ struct song *song =
+ song_dup_detached(queue_get_order(&playlist->queue, orderNum));
uri = song_get_uri(song);
g_debug("play %i:\"%s\"", orderNum, uri);
@@ -257,14 +258,14 @@ playlist_resume_playback(struct playlist *playlist, struct player_control *pc)
assert(playlist->playing);
assert(pc_get_state(pc) == PLAYER_STATE_STOP);
- error = pc_get_error(pc);
- if (error == PLAYER_ERROR_NOERROR)
+ error = pc_get_error_type(pc);
+ if (error == PLAYER_ERROR_NONE)
playlist->error_count = 0;
else
++playlist->error_count;
- if ((playlist->stop_on_error && error != PLAYER_ERROR_NOERROR) ||
- error == PLAYER_ERROR_AUDIO || error == PLAYER_ERROR_SYSTEM ||
+ if ((playlist->stop_on_error && error != PLAYER_ERROR_NONE) ||
+ error == PLAYER_ERROR_OUTPUT ||
playlist->error_count >= queue_length(&playlist->queue))
/* too many errors, or critical error: stop
playback */