From: Anton Baskanov <baskanov@gmail.com> --- dlls/dsound/mixer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index fa857fe96b4..ac8ab72e0f9 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -330,9 +330,10 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * UINT fir_cachesize = (fir_len + dsbfirstep - 2) / dsbfirstep; UINT required_input = max_ipos + fir_cachesize; - float *intermediate, *itmp; + float *intermediate, *output, *itmp; DWORD len = required_input * channels; + len += count * channels; len *= sizeof(float); *freqAccNum = freqAcc_end % dsb->freqAdjustDen; @@ -349,6 +350,7 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * } intermediate = dsb->device->cp_buffer; + output = intermediate + required_input * channels; if(dsb->use_committed) { committed_samples = (dsb->writelead - dsb->committed_mixpos) / istride; @@ -389,10 +391,14 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * for (j = 0; j < fir_used; j++) sum += (fir[idx + j * dsbfirstep] * (1.0f - rem) + fir[idx + j * dsbfirstep + 1] * rem) * cache[j]; - dsb->put(dsb, i * ostride, channel, sum * dsb->firgain); + output[channel * count + i] = sum * dsb->firgain; } } + for(i = 0; i < count; ++i) + for (channel = 0; channel < channels; channel++) + dsb->put(dsb, i * ostride, channel, output[channel * count + i]); + return max_ipos; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10182