summaryrefslogtreecommitdiff
path: root/lib/rbcodec
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-05-11 06:56:16 -0400
committerMichael Sevakis <jethead71@rockbox.org>2012-05-11 06:56:16 -0400
commitfbe9ccc85cbbd4355415694990fe58003c5c2beb (patch)
treebc91a0fef5d5d8fb438027a0cd94d5d918282651 /lib/rbcodec
parentdd59e1d789ca088b14e4020fd7296969e2195d75 (diff)
TDSpeed settings to setup call need to be recorded, always.
If the settings, like samplerate, were to go out of range where timestretch drops out of processing and then go back to the same as when they were valid, it would fail to switch back on by itelf. Change-Id: Ic5bcb268540b0db8e0483117b8a5a0ce5c5a9db0
Diffstat (limited to 'lib/rbcodec')
-rw-r--r--lib/rbcodec/dsp/tdspeed.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rbcodec/dsp/tdspeed.c b/lib/rbcodec/dsp/tdspeed.c
index 412d889ee8..8f32a62e0e 100644
--- a/lib/rbcodec/dsp/tdspeed.c
+++ b/lib/rbcodec/dsp/tdspeed.c
@@ -127,6 +127,10 @@ static bool tdspeed_update(int32_t samplerate, int32_t factor)
{
struct tdspeed_state_s *st = &tdspeed_state;
+ /* Save parameters we'll need later if format changes */
+ st->samplerate = samplerate;
+ st->factor = factor;
+
/* Check parameters */
if (factor == PITCH_SPEED_100)
return false;
@@ -137,10 +141,6 @@ static bool tdspeed_update(int32_t samplerate, int32_t factor)
if (factor < STRETCH_MIN || factor > STRETCH_MAX)
return false;
- /* Save parameters we'll need later if format changes */
- st->samplerate = samplerate;
- st->factor = factor;
-
st->dst_step = samplerate / MINFREQ;
if (factor > PITCH_SPEED_100)