player_thread: don't drop audio buffers when not seekable

When a file is not seekable, MPD dropped the audio buffers before even
attempting to seek.  This caused noticable sound corruption.  Fix:
first attempt to seek, and only if that succeeds, call
audio_output_all_cancel().
This commit is contained in:
Max Kellermann 2009-02-17 23:57:10 +01:00
parent 4aca1fa493
commit 9d2f16d827
1 changed files with 2 additions and 1 deletions

View File

@ -204,13 +204,14 @@ static void player_process_command(struct player *player)
break;
case PLAYER_COMMAND_SEEK:
audio_output_all_cancel();
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();
}
break;