player/CrossFade: fix inverted check and wrong variable

The inverted check was introduced by commit 46d00dd85f, and commit
8ad17d25ef added a check for the wrong variable.  D'oh!

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1303
This commit is contained in:
Max Kellermann 2021-10-22 11:48:46 +02:00
parent b8e0855ef3
commit 0c4bf12bfd
2 changed files with 4 additions and 2 deletions

2
NEWS
View File

@ -6,6 +6,8 @@ ver 0.23.2 (not yet released)
- pipewire: DSD support
* neighbor
- mention failed plugin name in error message
* player
- fix cross-fade regression
* fix crash with libfmt versions older than 7
ver 0.23.1 (2021/10/19)

View File

@ -34,8 +34,8 @@ inline bool
CrossFadeSettings::CanCrossFadeSong(SignedSongTime total_time) const noexcept
{
return !total_time.IsNegative() &&
duration >= MIN_TOTAL_TIME &&
duration >= std::chrono::duration_cast<FloatDuration>(total_time);
total_time >= MIN_TOTAL_TIME &&
duration < std::chrono::duration_cast<FloatDuration>(total_time);
}
gcc_pure