aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-10 17:52:38 +0100
committerMax Kellermann <max@duempel.org>2009-03-10 17:52:38 +0100
commit7d52284a96c634a9e36756ba88423d8fad346c6f (patch)
tree7975c8d72fc8eb838b4e52cf130d7524a49043f2
parent3ef8cba274153d2fa426195561f03acb7f4a2f32 (diff)
downloadmpd-7d52284a96c634a9e36756ba88423d8fad346c6f.tar.gz
mpd-7d52284a96c634a9e36756ba88423d8fad346c6f.tar.xz
mpd-7d52284a96c634a9e36756ba88423d8fad346c6f.zip
player_thread: moved code to player_seek_decoder()
Reset player.xfade and player.buffering from within player_seek_decoder(), not in the player_process_command() switch statement.
Diffstat (limited to '')
-rw-r--r--src/player_thread.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 022e97f0f..82628ddc0 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -247,12 +247,23 @@ static bool player_seek_decoder(struct player *player)
where = 0.0;
ret = dc_seek(&pc.notify, where);
- if (ret)
- pc.elapsed_time = where;
+ if (!ret) {
+ player_command_finished();
+ return false;
+ }
+ pc.elapsed_time = where;
player_command_finished();
- return ret;
+ player->xfade = XFADE_UNKNOWN;
+
+ /* abort buffering when the user has requested
+ a seek */
+ player->buffering = false;
+
+ audio_output_all_cancel();
+
+ return true;
}
static void player_process_command(struct player *player)
@@ -294,15 +305,7 @@ static void player_process_command(struct player *player)
break;
case PLAYER_COMMAND_SEEK:
- if (player_seek_decoder(player)) {
- player->xfade = XFADE_UNKNOWN;
-
- /* abort buffering when the user has requested
- a seek */
- player->buffering = false;
-
- audio_output_all_cancel();
- }
+ player_seek_decoder(player);
break;
case PLAYER_COMMAND_CANCEL: