summaryrefslogtreecommitdiff
path: root/apps/codecs/aac.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-02-07 00:51:50 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-02-07 00:51:50 +0000
commitaba6ca0881d1481b4047b2d7834d70ca2eb5c64b (patch)
tree6635b98840dcf4936b3c1ca641c00c32ea1b3e7f /apps/codecs/aac.c
parentdd50c863e60488662dee8f28f7292389ade42bac (diff)
downloadrockbox-aba6ca0881d1481b4047b2d7834d70ca2eb5c64b.tar.gz
rockbox-aba6ca0881d1481b4047b2d7834d70ca2eb5c64b.zip
Fix resampling clicking as much as possible at the moment. 1) Upsampling clicked because of size inaccuracies returned by DSP. Fix by simplifying audio system to use per-channel sample count from codec to pcm buffer. 2) Downsampling affected by 1) and was often starting passed the end of the data when not enough was available to generate an output sample. Fix by clamping input range to last sample in buffer and using the last sample value in the buffer. A perfect fix will require a double buffering scheme on the resampler to sufficient data during small data transients on both ends at all times of the down ratio on input and the up ratio on output.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12218 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/aac.c')
-rw-r--r--apps/codecs/aac.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 4695caab4a..7656c416fe 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -183,12 +183,8 @@ next_track:
183 183
184 /* Output the audio */ 184 /* Output the audio */
185 ci->yield(); 185 ci->yield();
186 while (!ci->pcmbuf_insert_split(decoder->time_out[0], 186 ci->pcmbuf_insert(decoder->time_out[0], decoder->time_out[1],
187 decoder->time_out[1], 187 frame_info.samples >> 1);
188 frame_info.samples * 2))
189 {
190 ci->sleep(1);
191 }
192 188
193 /* Update the elapsed-time indicator */ 189 /* Update the elapsed-time indicator */
194 sound_samples_done += sample_duration; 190 sound_samples_done += sample_duration;