diff options
-rw-r--r-- | src/CrossFade.cxx | 6 | ||||
-rw-r--r-- | src/CrossFade.hxx | 3 | ||||
-rw-r--r-- | src/PlayerThread.cxx | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/CrossFade.cxx b/src/CrossFade.cxx index bb585db5a..e3cc95b0d 100644 --- a/src/CrossFade.cxx +++ b/src/CrossFade.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "CrossFade.hxx" +#include "Chrono.hxx" #include "MusicChunk.hxx" #include "AudioFormat.hxx" #include "util/NumberParser.hxx" @@ -85,7 +86,7 @@ mixramp_interpolate(const char *ramp_list, float required_db) } unsigned -CrossFadeSettings::Calculate(float total_time, +CrossFadeSettings::Calculate(SignedSongTime total_time, float replay_gain_db, float replay_gain_prev_db, const char *mixramp_start, const char *mixramp_prev_end, const AudioFormat af, @@ -95,7 +96,8 @@ CrossFadeSettings::Calculate(float total_time, unsigned int chunks = 0; float chunks_f; - if (duration < 0 || duration >= total_time || + if (total_time.IsNegative() || + duration < 0 || duration >= total_time.ToDoubleS() || /* we can't crossfade when the audio formats are different */ af != old_format) return 0; diff --git a/src/CrossFade.hxx b/src/CrossFade.hxx index b385ea316..81e96e8d3 100644 --- a/src/CrossFade.hxx +++ b/src/CrossFade.hxx @@ -23,6 +23,7 @@ #include "Compiler.h" struct AudioFormat; +class SignedSongTime; struct CrossFadeSettings { /** @@ -60,7 +61,7 @@ struct CrossFadeSettings { * should be disabled for this song change */ gcc_pure - unsigned Calculate(float total_time, + unsigned Calculate(SignedSongTime total_time, float replay_gain_db, float replay_gain_prev_db, const char *mixramp_start, const char *mixramp_prev_end, diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx index c74fdeba6..c5308e612 100644 --- a/src/PlayerThread.cxx +++ b/src/PlayerThread.cxx @@ -1001,7 +1001,7 @@ Player::Run() calculate how many chunks will be required for it */ cross_fade_chunks = - pc.cross_fade.Calculate(dc.total_time.ToDoubleS(), + pc.cross_fade.Calculate(dc.total_time, dc.replay_gain_db, dc.replay_gain_prev_db, dc.GetMixRampStart(), |