From 7e43a42c887cc8b1be205a670cbc6193ea2e6939 Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 4 May 2014 05:45:53 +0200 Subject: [PATCH] Remove dead code: playback_next_bh and playback_prev_bh are only called during playback_pause. In playback_pause "cur_playing" is always set to NULL so that in playback_next_bh and playback_prev_bh only the else-clause can become true. --- src/player.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) 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) {