diff --git a/src/player/CrossFade.cxx b/src/player/CrossFade.cxx index caad86e74..d61c0d0a5 100644 --- a/src/player/CrossFade.cxx +++ b/src/player/CrossFade.cxx @@ -118,7 +118,7 @@ CrossFadeSettings::Calculate(SignedSongTime current_total_time, const auto chunk_duration = af.SizeToTime(sizeof(MusicChunk::data)); - if (mixramp_delay <= FloatDuration::zero() || + if (!IsMixRampEnabled() || !mixramp_start || !mixramp_prev_end) { chunks = lround(duration / chunk_duration); } else { diff --git a/src/player/CrossFade.hxx b/src/player/CrossFade.hxx index 8afda835c..38e919666 100644 --- a/src/player/CrossFade.hxx +++ b/src/player/CrossFade.hxx @@ -48,6 +48,10 @@ struct CrossFadeSettings { return duration.count() > 0; } + constexpr bool IsMixRampEnabled() const noexcept { + return mixramp_delay > FloatDuration::zero(); + } + /** * Calculate how many music pipe chunks should be used for crossfading. *