summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-12-28 21:13:52 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-12-28 21:13:52 +0000
commitb770d53cb41370acf6e36486877f1fb9931c97ef (patch)
tree8f96a60109475f2afd891f7ac5dd722482819d3b /apps/pcmbuf.c
parent41cea75095e6dcd17cff2f57c07553c0ec2a298e (diff)
Fixed the crossfade and track skipping glitches.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8292 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 4277dca379..f1988fd3f4 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -353,7 +353,7 @@ static void crossfade_process_buffer(
/* Prevent pcmbuffer from wrapping. */
if (pos >= pcmbuf_size)
pos -= pcmbuf_size;
- blocksize = MIN(pcmbuf_size - pos, blocksize);
+ blocksize = MIN((pcmbuf_size - pos)/2, blocksize);
buf = (short *)&audiobuffer[pos];
fade_out_rem -= blocksize;
@@ -413,14 +413,14 @@ static void crossfade_start(void)
fade_out_rem = NATIVE_FREQUENCY
* global_settings.crossfade_fade_out_duration * 2;
- /* Truncate fade out duration if necessary. */
- if (fade_out_rem > crossfade_rem)
- fade_out_rem = crossfade_rem;
-
/* We want only to modify the last part of the buffer. */
if (crossfade_rem > fade_out_rem + fade_out_delay)
crossfade_rem = fade_out_rem + fade_out_delay;
+ /* Truncate fade out duration if necessary. */
+ if (crossfade_rem < fade_out_rem + fade_out_delay)
+ fade_out_rem -= (fade_out_rem + fade_out_delay) - crossfade_rem;
+
/* Get also fade in duration and delays from settings. */
crossfade_fade_in_rem = NATIVE_FREQUENCY
* global_settings.crossfade_fade_in_duration * 2;