Commit 7d52284a authored by Max Kellermann's avatar Max Kellermann

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.
parent 3ef8cba2
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment