summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-12-09 11:12:51 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-12-09 11:16:40 +0100
commit2093f0749e9ef1475309f529ae93da5583572f9c (patch)
tree4b477307d3aff7b3a75a2f11f1eca6db04b2195f /src
parente0f70a2cc1d10b65f5b7cf5bd832121510e66a11 (diff)
Serato BeatsGrid: Fix wrong beat at position 0 on import
The wrong usage of `QVector<T>::resize(int)` instead of `QVector<T>::reserve(int)` always created a bunch of beats at sample position 0, even if there is no actual beat at that position. This could lead to audible sudden tempo changes when sync is used.
Diffstat (limited to 'src')
-rw-r--r--src/track/serato/beatsimporter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/track/serato/beatsimporter.cpp b/src/track/serato/beatsimporter.cpp
index 9c0007885f..dc67ab9d9d 100644
--- a/src/track/serato/beatsimporter.cpp
+++ b/src/track/serato/beatsimporter.cpp
@@ -57,7 +57,7 @@ QVector<double> SeratoBeatsImporter::importBeatsAndApplyTimingOffset(
beatLengthMillis = (nextBeatPositionMillis - beatPositionMillis) /
pMarker->beatsTillNextMarker();
- beats.resize(beats.size() + pMarker->beatsTillNextMarker());
+ beats.reserve(beats.size() + pMarker->beatsTillNextMarker());
for (quint32 j = 0; j < pMarker->beatsTillNextMarker(); ++j) {
beats.append(streamInfo.getSignalInfo().millis2frames(
beatPositionMillis + (j * beatLengthMillis)));