From: Max Kellermann Date: Mon, 2 Nov 2009 17:53:07 +0000 (+0100) Subject: player_command: break from switch if not playing X-Git-Tag: release-0.16~38 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d14a5d89609fbbbdf1dec6248f8afa9470824996;p=ncmpc.git player_command: break from switch if not playing Eliminate one indent level. --- diff --git a/src/player_command.c b/src/player_command.c index 54664e5..226d18c 100644 --- a/src/player_command.c +++ b/src/player_command.c @@ -121,17 +121,21 @@ handle_player_command(struct mpdclient *c, command_t cmd) break; case CMD_SEEK_FORWARD: song = mpdclient_get_current_song(c); - if (song != NULL) { - if (seek_id != (int)mpd_song_get_id(song)) { - seek_id = mpd_song_get_id(song); - seek_target_time = mpd_status_get_elapsed_time(c->status); - } - seek_target_time+=options.seek_time; - if (seek_target_time > (int)mpd_status_get_total_time(c->status)) - seek_target_time = mpd_status_get_total_time(c->status); - schedule_seek_timer(c); + if (song == NULL) + break; + + if (seek_id != (int)mpd_song_get_id(song)) { + seek_id = mpd_song_get_id(song); + seek_target_time = mpd_status_get_elapsed_time(c->status); } + + seek_target_time += options.seek_time; + if (seek_target_time > (int)mpd_status_get_total_time(c->status)) + seek_target_time = mpd_status_get_total_time(c->status); + + schedule_seek_timer(c); break; + case CMD_TRACK_NEXT: connection = mpdclient_get_connection(c); if (connection == NULL) @@ -142,17 +146,21 @@ handle_player_command(struct mpdclient *c, command_t cmd) break; case CMD_SEEK_BACKWARD: song = mpdclient_get_current_song(c); - if (song != NULL) { - if (seek_id != (int)mpd_song_get_id(song)) { - seek_id = mpd_song_get_id(c->song); - seek_target_time = mpd_status_get_elapsed_time(c->status); - } - seek_target_time-=options.seek_time; - if (seek_target_time < 0) - seek_target_time=0; - schedule_seek_timer(c); + if (song == NULL) + break; + + if (seek_id != (int)mpd_song_get_id(song)) { + seek_id = mpd_song_get_id(c->song); + seek_target_time = mpd_status_get_elapsed_time(c->status); } + + seek_target_time -= options.seek_time; + if (seek_target_time < 0) + seek_target_time = 0; + + schedule_seek_timer(c); break; + case CMD_TRACK_PREVIOUS: connection = mpdclient_get_connection(c); if (connection == NULL)