[PATCH RFC 1/5] dsound: Clean up MixToTemporary()

Alexander E. Patrakov patrakov at gmail.com
Sat Dec 24 08:58:27 CST 2011

This is the first patch in a series of cleanups that I prepared for
dsound in order to ease the development of a new resampler. It depends
on a previously posted patch "dsound: Always resample buffers in mixer
thread". As this is just a cleanup, I am indifferent if this ends up in
wine-1.4. Anyway, my further work on the resampler depends on this

The most important part of the patch consists of refactoring
DSOUND_MixToTemporary in such a way that it accepts the length of the
temporary buffer, not the secondary buffer. This avoids some unneeded
back-and-forth conversions between secondary buffer and device samples,
and the possible rounding errors due to that.

This also exposed the fact that the reason to use freqAccNext in
DSOUND_bufpos_to_secpos became invalid after moving the resampler to
the mixer thread. Moreover, this use of freqAccNext was the cause of
audible clicks in an old version of my resampler patch (bug 14717). So
the first part of the patch deals with it.

Alexander E. Patrakov

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-dsound-Clean-up-MixToTemporary.txt
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20111224/41f63eac/attachment.txt>

More information about the wine-patches mailing list