summaryrefslogtreecommitdiff
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
parentdd59e1d789ca088b14e4020fd7296969e2195d75 (diff)
downloadrockbox-fbe9ccc85cbbd4355415694990fe58003c5c2beb.tar.gz
rockbox-fbe9ccc85cbbd4355415694990fe58003c5c2beb.zip
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
-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)
127{ 127{
128 struct tdspeed_state_s *st = &tdspeed_state; 128 struct tdspeed_state_s *st = &tdspeed_state;
129 129
130 /* Save parameters we'll need later if format changes */
131 st->samplerate = samplerate;
132 st->factor = factor;
133
130 /* Check parameters */ 134 /* Check parameters */
131 if (factor == PITCH_SPEED_100) 135 if (factor == PITCH_SPEED_100)
132 return false; 136 return false;
@@ -137,10 +141,6 @@ static bool tdspeed_update(int32_t samplerate, int32_t factor)
137 if (factor < STRETCH_MIN || factor > STRETCH_MAX) 141 if (factor < STRETCH_MIN || factor > STRETCH_MAX)
138 return false; 142 return false;
139 143
140 /* Save parameters we'll need later if format changes */
141 st->samplerate = samplerate;
142 st->factor = factor;
143
144 st->dst_step = samplerate / MINFREQ; 144 st->dst_step = samplerate / MINFREQ;
145 145
146 if (factor > PITCH_SPEED_100) 146 if (factor > PITCH_SPEED_100)