diff --git a/src/player.c b/src/player.c index 2b29f5c2..1f24a5e0 100644 --- a/src/player.c +++ b/src/player.c @@ -2633,19 +2633,18 @@ playback_prev_bh(struct player_command *cmd) { int ret; - if (cur_playing) + if (!cur_streaming) { - if (cur_playing->end > cur_playing->stream_start) - history_add(cur_playing->id); - source_stop(cur_playing); - } - else if (cur_streaming) - { - if (cur_streaming->end > cur_streaming->stream_start) - history_add(cur_streaming->id); - source_stop(cur_streaming); + DPRINTF(E_LOG, L_PLAYER, "Could not get current stream source\n"); + return -1; } + /* Only add to history if playback started. */ + if (cur_streaming->end > cur_streaming->stream_start) + history_add(cur_streaming->id); + + source_stop(cur_streaming); + ret = source_prev(); if (ret < 0) { @@ -2673,19 +2672,18 @@ playback_next_bh(struct player_command *cmd) { int ret; - if (cur_playing) + if (!cur_streaming) { - if (cur_playing->end > cur_playing->stream_start) - history_add(cur_playing->id); - source_stop(cur_playing); - } - else if (cur_streaming) - { - if (cur_streaming->end > cur_streaming->stream_start) - history_add(cur_streaming->id); - source_stop(cur_streaming); + DPRINTF(E_LOG, L_PLAYER, "Could not get current stream source\n"); + return -1; } + /* Only add to history if playback started. */ + if (cur_streaming->end > cur_streaming->stream_start) + history_add(cur_streaming->id); + + source_stop(cur_streaming); + ret = source_next(1); if (ret < 0) {