From 92bfdd1e8dde346eb710f73eaefd8c6a29befcee Mon Sep 17 00:00:00 2001 From: oparviai Date: Fri, 7 Apr 2017 19:01:22 +0000 Subject: [PATCH] Fixed a bug introduced in r245 that caused small constant time offset in the output vs. input stream --- README.html | 5 +++-- source/SoundTouch/TDStretch.cpp | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.html b/README.html index eac9ceb..fcd8e31 100644 --- a/README.html +++ b/README.html @@ -587,8 +587,8 @@ this corresponds to lowering the pitch by -0.318 semitones:

@@ -855,6 +855,7 @@ submitted bugfixes:

  • Mathias Möhl
  • Yuval Naveh
  • Mats Palmgren
  • +
  • Chandni Patel
  • Paulo Pizarro
  • Andrey Ponomarenko
  • Blaise Potard
  • diff --git a/source/SoundTouch/TDStretch.cpp b/source/SoundTouch/TDStretch.cpp index 8343f91..3403969 100644 --- a/source/SoundTouch/TDStretch.cpp +++ b/source/SoundTouch/TDStretch.cpp @@ -675,11 +675,10 @@ void TDStretch::processSamples() } else { - // Adjust processing offset at beginning of track: - // - do not perform initial overlapping - // - compensate expected value of 'seekBestOverlapPosition' offset landing to middle of seekLength + // Adjust processing offset at beginning of track by not perform initial overlapping + // and compensating that in the 'input buffer skip' calculation isBeginning = false; - int skip = overlapLength + seekLength / 2; + int skip = (int)(tempo * overlapLength + 0.5); #ifdef SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION #ifdef SOUNDTOUCH_ALLOW_SSE