http://bugs.winehq.org/show_bug.cgi?id=14717
--- Comment #104 from Krzysztof Nikiel zzdz2@yahoo.pl 2011-01-01 10:57:22 CST --- (In reply to comment #96)
In the downsampling case your patch causes foobar2000 to eat 100% CPU. stutter (e.g., it says "wr-wr-ro-ro-ong-ong-n" instead of "wrong") and move the position slider back and forth on quality settings other than 0 or 1. And on these quality settings, the transition frequency is severely miscalculated (according to my test with playing white noise wav file in foobar2000 and recording wine output digitally, it is around 2 kHz at quality 1 and around 3 kHz at quality 0).
This should help:
diff --git a/dlls/dsound/resample.c b/dlls/dsound/resample.c index e8bc2ad..7486d78 100644 --- a/dlls/dsound/resample.c +++ b/dlls/dsound/resample.c @@ -346,9 +346,8 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl * dsb)
dsb->inpos = dsb->infrac = 0; /* reset resampler pointer */
- if (dsb->freq < dsb->outfreq) - dsb->firstep = g_fir[dsb->quality]->step; - else if (dsb->freq > dsb->outfreq) + dsb->firstep = g_fir[dsb->quality]->step; + if (dsb->outfreq < dsb->freq) { /* move transition band below output nuquist */ dsb->firstep = (9 * dsb->firstep * dsb->outfreq) / (10 * dsb->freq); @@ -360,7 +359,7 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl * dsb) if (dsb->firstep < 1) dsb->firstep = 1; } - else + else if (dsb->freq == dsb->outfreq) dsb->firstep = 1;
TRACE("resample quality: %d\n", dsb->quality);