Presumed correct patch for remaining winmm test failures

Jeremy White jwhite at codeweavers.com
Sun Feb 27 17:48:19 CST 2005


This crow is not tasting very good; almost immediately after boldly claiming
that there was no correct way to account for the msacm wierdness
in Wine, I realized that there actually was a proper way to do that.

Specifically, if we are converting an input [aka outer] stereo stream at
8,000 samples per second into an output [aka inner] stereo stream
at 48,000 sample per second, you would rationally expect a conversion
of 2 bytes of input to 12 bytes of output.  However, msacm perversely
converts those 2 bytes of input to 8 bytes of output.  Then, when we
go to report our position, we divide that 8 by the 6 (effectively), and
we report 1 or 0 as our byte position on the outer stream.  But 1 is a nonsensical value,
as our stream is supposed to be aligned on 2 byte boundaries, and we should
have recognized that we had started a partial output.

What we need to do, then, I believe, is detect cases where we
are up sampling and where we have a remainder; any partial write to
the inner stream needs to be treated as a full additional write to
the outer stream.  Hence, those extra 2 bytes need to be rounded up
and considered a full pair of bytes when we report the result.

I've tested this pretty carefully and it works for me and I think
it's right.  But my track record here is perhaps a bit weak, so
I'd appreciate review...:-/

Changelog:
   Aggresively round up to the proper alignment when reporting
position on streams where we are converting up.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wavemap.diff
Type: text/x-patch
Size: 3327 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050227/1ae4e59f/wavemap.bin


More information about the wine-patches mailing list