From 47efba8bbfd17cb6d95ce1039e0114dc24a9dc68 Mon Sep 17 00:00:00 2001 From: Stepan Moskovchenko Date: Wed, 3 May 2006 05:18:18 +0000 Subject: Fix file descriptor leak that would cause a hard lockup every 7 files played. A few other cosmetic changes. please, please no red build =) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9865 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/midi/synth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apps/plugins/midi/synth.c') diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index 44417b2583..a364889ea0 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c @@ -272,7 +272,7 @@ signed short int synthVoice(struct SynthObject * so) so->cp += so->delta; } - cpShifted = so->cp >> 10; //Was 10 + cpShifted = so->cp >> FRACTSIZE; //Was 10 if( (cpShifted > (wf->numSamples) && (so->state != STATE_RAMPDOWN))) { @@ -286,7 +286,7 @@ signed short int synthVoice(struct SynthObject * so) { if(wf->mode & LOOP_REVERSE) { - so->cp = (wf->endLoop)<<10; //Was 10 + so->cp = (wf->endLoop)<endLoop; s2=getSample((cpShifted), wf); } @@ -302,7 +302,7 @@ signed short int synthVoice(struct SynthObject * so) so->loopState = STATE_LOOPING; if((wf->mode & (24)) == 0) { - so->cp = (wf->startLoop)<<10; //Was 10 + so->cp = (wf->startLoop)<startLoop; s2=getSample((cpShifted), wf); } @@ -315,8 +315,8 @@ signed short int synthVoice(struct SynthObject * so) /* Better, working, linear interpolation */ s1=getSample((cpShifted), wf); //\|/ Was 1023)) >> 10 - s = s1 + ((signed)((s2 - s1) * (so->cp & 1023))>>10); //Was 10 - +// s = s1 + ((signed)((s2 - s1) * (so->cp & (1023)))>>10); //Was 10 + s = s1 + ((signed)((s2 - s1) * (so->cp & ((1<>FRACTSIZE); //Was 10 /* ADSR COMMENT WOULD GO FROM HERE.........*/ -- cgit v1.2.3