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:
parent
4aca1fa493
commit
9d2f16d827
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue