1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-19 17:40:15 +02:00

LIBSAMPLERATE needs to update the factor each time. Thanks to Rob Sykes.

This commit is contained in:
martynshaw99 2012-11-20 00:16:58 +00:00
parent 4b9a934ab4
commit 8b6a9ca3d7
2 changed files with 1 additions and 7 deletions

View File

@ -206,7 +206,6 @@
int err; int err;
SRC_STATE *state = src_new(mMethod, 1, &err); SRC_STATE *state = src_new(mMethod, 1, &err);
mHandle = (void *)state; mHandle = (void *)state;
mInitial = true;
} }
VarRateResample::~VarRateResample() VarRateResample::~VarRateResample()
@ -263,10 +262,7 @@
float *outBuffer, float *outBuffer,
int outBufferLen) int outBufferLen)
{ {
if (mInitial) { src_set_ratio((SRC_STATE *)mHandle, factor);
src_set_ratio((SRC_STATE *)mHandle, factor);
mInitial = false;
}
SRC_DATA data; SRC_DATA data;

View File

@ -39,7 +39,6 @@ class Resample
mMethod = GetFastMethod(); mMethod = GetFastMethod();
mHandle = NULL; mHandle = NULL;
mInitial = false;
}; };
virtual ~Resample() {}; virtual ~Resample() {};
@ -116,7 +115,6 @@ class Resample
protected: protected:
int mMethod; // resampler-specific enum for resampling method int mMethod; // resampler-specific enum for resampling method
void* mHandle; // constant-rate or variable-rate resampler (XOR per instance) void* mHandle; // constant-rate or variable-rate resampler (XOR per instance)
bool mInitial;
}; };
class ConstRateResample : public Resample class ConstRateResample : public Resample