Commit 6f59d71e authored by Max Kellermann's avatar Max Kellermann

decoder/API: check initial_seek_running in _check_cancel_read()

The "seeking" flag is not set for the initial seek, and so decoder_read() could be canceled when another SEEK was emitted during initial seek. This fixes several seek problems, for example the one reported for the FLAC decoder plugin: https://bugs.musicpd.org/view.php?id=4552
parent f9130f42
ver 0.19.17 (not yet released) ver 0.19.17 (not yet released)
* decoder * decoder
- flac: fix assertion failure while seeking - flac: fix assertion failure while seeking
- fix seek problems in several plugins
* fix spurious seek error "Failed to allocate silence buffer" * fix spurious seek error "Failed to allocate silence buffer"
* replay gain: fix "replay_gain_handler mixer" setting * replay gain: fix "replay_gain_handler mixer" setting
* DSD: use 0x69 as silence pattern * DSD: use 0x69 as silence pattern
......
...@@ -301,7 +301,8 @@ decoder_check_cancel_read(const Decoder *decoder) ...@@ -301,7 +301,8 @@ decoder_check_cancel_read(const Decoder *decoder)
/* ignore the SEEK command during initialization, the plugin /* ignore the SEEK command during initialization, the plugin
should handle that after it has initialized successfully */ should handle that after it has initialized successfully */
if (dc.command == DecoderCommand::SEEK && if (dc.command == DecoderCommand::SEEK &&
(dc.state == DecoderState::START || decoder->seeking)) (dc.state == DecoderState::START || decoder->seeking ||
decoder->initial_seek_running))
return false; return false;
return true; return true;
......
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