Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix time offset in key and beat analysis #2152

Merged
merged 14 commits into from
Aug 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/analyzer/plugins/buffering_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ bool DownmixAndOverlapHelper::processStereoSamples(const CSAMPLE* pInput, size_t
bool DownmixAndOverlapHelper::finalize() {
// We need to append at least m_windowSize / 2 - m_stepSize silence
// to have a valid analysis results for the last track samples.
// Since we go in fixed steps up to "m_stepSize - 1" samples remains
// unrocessed. That th reason we use "m_windowSize / 2 - 1" below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor typos in comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping

// instead of "m_windowSize / 2 - m_stepSize"
size_t framesToFillWindow = m_windowSize - m_bufferWritePosition;
size_t numInputFrames = framesToFillWindow;
if (numInputFrames < m_windowSize / 2 - 1) {
// -1 ensures that silence < m_stepSize ramains unprocessed
numInputFrames = m_windowSize / 2 - 1;
}
size_t numInputFrames = math_max(framesToFillWindow, m_windowSize / 2 - 1);
return processInner(nullptr, numInputFrames);
}

Expand Down