Commit 9d2f16d8 authored by Max Kellermann's avatar Max Kellermann

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().
parent 4aca1fa4
...@@ -204,13 +204,14 @@ static void player_process_command(struct player *player) ...@@ -204,13 +204,14 @@ static void player_process_command(struct player *player)
break; break;
case PLAYER_COMMAND_SEEK: case PLAYER_COMMAND_SEEK:
audio_output_all_cancel();
if (player_seek_decoder(player)) { if (player_seek_decoder(player)) {
player->xfade = XFADE_UNKNOWN; player->xfade = XFADE_UNKNOWN;
/* abort buffering when the user has requested /* abort buffering when the user has requested
a seek */ a seek */
player->buffering = false; player->buffering = false;
audio_output_all_cancel();
} }
break; break;
......
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