mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
Bugfix and cleanups
This commit is contained in:
parent
8c65661b91
commit
55aa6f15e9
@ -48,8 +48,8 @@
|
||||
using namespace soundtouch;
|
||||
using namespace std;
|
||||
|
||||
// Processing chunk size
|
||||
#define BUFF_SIZE 2048
|
||||
// Processing chunk size (size chosen to be divisible by 2, 4, 6, 8, 10, 12, 14, 16 channels ...)
|
||||
#define BUFF_SIZE 6720
|
||||
|
||||
#if _WIN32
|
||||
#include <io.h>
|
||||
|
||||
@ -394,9 +394,9 @@ RateTransposerInteger::~RateTransposerInteger()
|
||||
void RateTransposerInteger::resetRegisters()
|
||||
{
|
||||
iSlopeCount = 0;
|
||||
if (sPrevSample) delete[] sPrevSample;
|
||||
delete[] sPrevSample;
|
||||
sPrevSample = new SAMPLETYPE[numChannels];
|
||||
memset(sPrevSample, 0, numChannels*sizeof(*sPrevSample));
|
||||
memset(sPrevSample, 0, numChannels * sizeof(SAMPLETYPE));
|
||||
}
|
||||
|
||||
|
||||
@ -579,7 +579,7 @@ RateTransposerFloat::RateTransposerFloat() : RateTransposer()
|
||||
{
|
||||
// Notice: use local function calling syntax for sake of clarity,
|
||||
// to indicate the fact that C++ constructor can't call virtual functions.
|
||||
sPrevSample=0;
|
||||
sPrevSample = NULL;
|
||||
RateTransposerFloat::resetRegisters();
|
||||
RateTransposerFloat::setRate(1.0f);
|
||||
}
|
||||
@ -587,16 +587,16 @@ RateTransposerFloat::RateTransposerFloat() : RateTransposer()
|
||||
|
||||
RateTransposerFloat::~RateTransposerFloat()
|
||||
{
|
||||
if (sPrevSample) delete[] sPrevSample;
|
||||
delete[] sPrevSample;
|
||||
}
|
||||
|
||||
|
||||
void RateTransposerFloat::resetRegisters()
|
||||
{
|
||||
fSlopeCount = 0;
|
||||
if (sPrevSample) delete[] sPrevSample;
|
||||
delete[] sPrevSample;
|
||||
sPrevSample = new SAMPLETYPE[numChannels];
|
||||
memset(sPrevSample, 0, numChannels*sizeof(*sPrevSample));
|
||||
memset(sPrevSample, 0, numChannels * sizeof(SAMPLETYPE));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -51,8 +51,6 @@
|
||||
#include "cpu_detect.h"
|
||||
#include "TDStretch.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace soundtouch;
|
||||
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
@ -159,7 +157,6 @@ void TDStretch::setParameters(int aSampleRate, int aSequenceMS,
|
||||
|
||||
// set tempo to recalculate 'sampleReq'
|
||||
setTempo(tempo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -511,7 +508,6 @@ void TDStretch::processNominalTempo()
|
||||
}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// Processes as many processing frames of the samples 'inputBuffer', store
|
||||
// the result into 'outputBuffer'
|
||||
@ -601,7 +597,7 @@ void TDStretch::acceptNewOverlapLength(int newOverlapLength)
|
||||
{
|
||||
delete[] pMidBufferUnaligned;
|
||||
|
||||
pMidBufferUnaligned = new SAMPLETYPE[overlapLength * 2 + 16 / sizeof(SAMPLETYPE)];
|
||||
pMidBufferUnaligned = new SAMPLETYPE[overlapLength * channels + 16 / sizeof(SAMPLETYPE)];
|
||||
// ensure that 'pMidBuffer' is aligned to 16 byte boundary for efficiency
|
||||
pMidBuffer = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(pMidBufferUnaligned);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user