MSACM: initialize some ACMSTREAMHEADER fields for the sake of native codecs

Alex Villací­s Lasso a_villacis at palosanto.com
Wed Dec 28 16:18:36 CST 2005


The ACMAPP sample application from MSDN reveals this annoying bug in 
playback: with a native ACM codec (such as the Ogg Vorbis one bundled 
with some Japanese RPGs), builtin msacm will successfully tell the codec 
to decode the first two frames of compressed audio, and then the sound 
will loop on these two frames. What is really happening is that winmm is 
using double-buffering, and reusing the ACMSTREAMHEADER structures for 
playback, and acmStreamConvert simply passes the structures into the 
codec, without clearing cb[Src|Dst]LengthUsed (here is the bug) which 
was set in the previous call to acmStreamConvert on that 
ACMSTREAMHEADER. The native codec *expects* these fields to be set to 0, 
and refuses to decode otherwise.

Attached patch fixes bug by initializing the expected fields to zero.

Changelog:
* Initialize cb[Src|Dst]LengthUsed to 0 before calling into codec, 
required by (some?) native codecs.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-msacm-acmStreamConvert-initialize.patch
Type: text/x-patch
Size: 485 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20051228/d7bc59d1/wine-msacm-acmStreamConvert-initialize.patch


More information about the wine-patches mailing list