Skip to content

Commit

Permalink
analyzersilence.cpp cf regression pull 13545
Browse files Browse the repository at this point in the history
Adjust lasttSampleBeforeFadeOut (and avoid a regression with lastSoundSample) to bring it into line with mixxxdj#13545
(I assume I was working off an older code base.)
  • Loading branch information
davidlmorris committed Oct 19, 2024
1 parent 2129011 commit 6ac0c22
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/analyzer/analyzersilence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ SINT AnalyzerSilence::findFirstFadeOutChunk(std::span<const CSAMPLE> samples) {
kFadeOutThreshold),
samples.rend()) -
1;
// if we don't find it (track only partially loaded - and/or pathological)
// give us the track size.
if (ret == -1) {
ret = samples.size();
}
return ret;
}

Expand Down Expand Up @@ -159,14 +154,14 @@ bool AnalyzerSilence::processSamples(const CSAMPLE* pIn, SINT count) {
}
if (m_fadeThresholdFadeInEnd >= 0) {
const SINT lasttSampleBeforeFadeOut = findFirstFadeOutChunk(samples);
if (lasttSampleBeforeFadeOut < (count - 1)) {
if (lasttSampleBeforeFadeOut >= 0) {
m_fadeThresholdFadeOutStart = m_framesProcessed +
(lasttSampleBeforeFadeOut / m_channelCount) + 1;
}
}
if (m_fadeThresholdFadeOutStart >= 0) {
const SINT lastSoundSample = findLastSoundInChunk(samples);
if (lastSoundSample < (count - 1)) { // not only sound or silence
if (lastSoundSample >= 0) {
m_signalEnd = m_framesProcessed + (lastSoundSample / m_channelCount) + 1;
}
}
Expand Down

0 comments on commit 6ac0c22

Please sign in to comment.