path: root/apps/codecs/nsf.c
diff options
authorMichael Sevakis <>2007-02-07 00:51:50 +0000
committerMichael Sevakis <>2007-02-07 00:51:50 +0000
commitaba6ca0881d1481b4047b2d7834d70ca2eb5c64b (patch)
tree6635b98840dcf4936b3c1ca641c00c32ea1b3e7f /apps/codecs/nsf.c
parentdd50c863e60488662dee8f28f7292389ade42bac (diff)
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:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/nsf.c')
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/codecs/nsf.c b/apps/codecs/nsf.c
index 77043b60ce..f138fa1e01 100644
--- a/apps/codecs/nsf.c
+++ b/apps/codecs/nsf.c
@@ -4445,9 +4445,7 @@ init_nsf:
goto init_nsf;
- while (!ci->pcmbuf_insert((char *)samples, written))
- ci->yield();
+ ci->pcmbuf_insert(samples, NULL, written >> 1);