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.
This commit is contained in:
chme 2014-05-04 05:45:53 +02:00
parent 79646c78e4
commit 7e43a42c88

View File

@ -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)
{