winmm: Fix GetPosition when using MSACM codecs.

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Mon Mar 11 10:56:09 CDT 2013


Hi,

In bug #33045 comment #18, I noticed that GetPosition
returns bogus numbers with ACM codecs, e.g.
wave.c:1626: Test failed: after position: 15655 samples
wave.c:1632: Test failed: after position: 4007680 bytes - not * 256

Here's a fix.  The code must not use blockalign of the original format,
as that's e.g. 256 with IMA_ADPCM.  When using the ACM, AvgBytesPerSec is all we
have, so we must trust it.  When using PCM, the code in Wine already
corrects bogus AvgBytesPerSec as needed.

With the patch in place, Wine returns the same GetPosition as native (on
the few data samples that we've been using in bug #33045).

Perhaps I should not have changed the TIME_MS part, because my tests indicate
that TIME_MS was never ever supported by waveIn/OutGetPos on w95, w2k, wxp, w7.
So I'll likely write a patch soon to remove that code entirely.

Regards,
	Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-winmm-Fix-GetPosition-when-using-MSACM-codecs.patch
Type: application/octet-stream
Size: 2437 bytes
Desc: 0003-winmm-Fix-GetPosition-when-using-MSACM-codecs.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130311/adde9bf5/attachment-0001.obj>


More information about the wine-patches mailing list