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.
This commit is contained in:
parent
3ef8cba274
commit
7d52284a96
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue