player/thread: wait for the first chunk in CheckCrossFade()

This fixes MixRamp problems which occur because CheckCrossFade() is
called before the decoder has parsed MixRamp tags after
DecoderClient::Ready().

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2084
This commit is contained in:
Max Kellermann 2024-07-25 19:55:38 +02:00
parent a693052f2c
commit f030b22bec
2 changed files with 5 additions and 1 deletions

1
NEWS
View File

@ -42,6 +42,7 @@ ver 0.24 (not yet released)
- opus: implement bitrate calculation - opus: implement bitrate calculation
- sidplay: require libsidplayfp (drop support for the original sidplay) - sidplay: require libsidplayfp (drop support for the original sidplay)
- wavpack: require libwavpack version 5 - wavpack: require libwavpack version 5
- fix MixRamp bug
* resampler * resampler
- soxr: require libsoxr 0.1.2 or later - soxr: require libsoxr 0.1.2 or later
* player * player

View File

@ -857,9 +857,12 @@ Player::CheckCrossFade() noexcept
return; return;
} }
if (!IsDecoderAtNextSong() || dc.IsStarting()) if (!IsDecoderAtNextSong() || dc.IsStarting() || dc.pipe->IsEmpty())
/* we need information about the next song before we /* we need information about the next song before we
can decide */ can decide */
/* the "pipe.empty" check is here so we wait for all
(ReplayGain/MixRamp) metadata to appear, which some
decoders parse only after reporting readiness */
return; return;
if (!pc.cross_fade.CanCrossFade(pc.total_time, dc.total_time, if (!pc.cross_fade.CanCrossFade(pc.total_time, dc.total_time,