diff options
Diffstat (limited to 'src/playlist.c')
-rw-r--r-- | src/playlist.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/playlist.c b/src/playlist.c index dc6d8c340..2532d9d46 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -19,13 +19,9 @@ #include "config.h" #include "playlist_internal.h" -#include "playlist_save.h" #include "player_control.h" -#include "command.h" -#include "tag.h" #include "song.h" #include "conf.h" -#include "stored_playlist.h" #include "idle.h" #include <glib.h> @@ -78,14 +74,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 +183,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 +254,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 */ |