winmm: Fix GetPosition when using MSACM codecs. (v2)

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Tue Mar 12 06:24:07 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).

[v2 without the superfluous change to the TIME_MS code that's
soon going to disappear.]

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: 2128 bytes
Desc: 0003-winmm-Fix-GetPosition-when-using-MSACM-codecs.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130312/03688183/attachment.obj>


More information about the wine-patches mailing list