From e385e5e467bfd4f251ff9477941e49518013ad90 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sun, 15 Dec 2002 01:12:27 +0000 Subject: [PATCH] Our resampling algorithm is quite primitive so try simple 8/16 mono/stereo conversions first. Only resample if we cannot avoid it. --- dlls/winmm/wavemap/wavemap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/winmm/wavemap/wavemap.c b/dlls/winmm/wavemap/wavemap.c index f6ccbf6b727..cf7dd3811cb 100644 --- a/dlls/winmm/wavemap/wavemap.c +++ b/dlls/winmm/wavemap/wavemap.c @@ -188,6 +188,19 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) if (wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT) == MMSYSERR_NOERROR) \ {wom->avgSpeedInner = wfx.nAvgBytesPerSec; goto found;} + /* Our resampling algorithm is quite primitive so first try + * to just change the bit depth and number of channels + */ + for (i = ndlo; i < ndhi; i++) { + wfx.nSamplesPerSec=lpDesc->lpFormat->nSamplesPerSec; + wfx.nChannels = lpDesc->lpFormat->nChannels; + TRY(wfx.nSamplesPerSec, 16); + TRY(wfx.nSamplesPerSec, 8); + wfx.nChannels ^= 3; + TRY(wfx.nSamplesPerSec, 16); + TRY(wfx.nSamplesPerSec, 8); + } + for (i = ndlo; i < ndhi; i++) { /* first try with same stereo/mono option as source */ wfx.nChannels = lpDesc->lpFormat->nChannels;