Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/analyzer/analyzersilence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ SINT AnalyzerSilence::findFirstSoundInChunk(std::span<const CSAMPLE> samples) {
SINT AnalyzerSilence::findLastSoundInChunk(std::span<const CSAMPLE> samples) {
// -1 is required, because the distance from the fist sample index (0) to crend() is 1,
SINT ret = std::distance(first_sound(samples.rbegin(), samples.rend()), samples.rend()) - 1;
if (ret == -1) {
ret = samples.size();
}
return ret;
}

Expand All @@ -93,7 +90,7 @@ bool AnalyzerSilence::processSamples(const CSAMPLE* pIn, SINT count) {
}
if (m_signalStart >= 0) {
const SINT lastSoundSample = findLastSoundInChunk(samples);
if (lastSoundSample < count - 1) { // not only sound or silence
if (lastSoundSample >= 0) {
m_signalEnd = m_framesProcessed + lastSoundSample / mixxx::kAnalysisChannels + 1;
}
}
Expand Down