[Fwd: Re: winemp3.acm: Fixes the Mac-specific code]

Kristofer Henriksson kthenriksson at gmail.com
Thu May 13 11:14:00 CDT 2010


Aric,

I may have been operating under some faulty assumptions. I thought
that all mp3 files would "begin at the beginning" and also keep track
of how much of the source data the convert function said that it used.
I am very careful to set the value of *nsrc to agree with how much
source data was successfully used and assume that the calling function
with resend the data that is not used. If this is done, it ensures a
valid frame at the start of each invocation.

As far as using AudioFileStream, I tried for a bit to get it to work
before I wrote my own custom mp3 parser. I'm running Snow Leopard
(10.6.3) and never got the background music to work in Oblivion. One
of the problems is that Mp3AudioConverterComplexInputDataProc needs to
return an error if it will have more data in the future, rather than
returning zero. However, even changing this, AudioFileStream seemed to
be skipping a lot of mp3 frames.

If you tell me what are more appropriate assumptions I should be
making in my parser, I can fix it to work the way it should. I suppose
I am also assuming that it will usually receive at least one full
packet, and if this is unjustified I can fix this as well. If I should
expect calling functions to ignore the value of *nsrc, then I can just
implement an internal single-packet buffer, and this should take care
of the problem.

However, you said this seems to be happening at the beginning of the
sound clip. Is this happening at the very beginning, with the first
invocation? I haven't anticipated the possibility that the parser
might be given invalid data (since an mp3 must begin with an ID3 tag
or a frame header). I'll appreciate any input you have on the matter.

Thanks,
Kristofer Henriksson

On Thu, May 13, 2010 at 8:10 AM, Aric Stewart <aric at codeweavers.com> wrote:
>
> Hi,
>  It is good to see someone working on this code.  But your patch makes it so
> that all the mp3 sound clips in the game that I was coding for stop working.
>
> trace:mpeg3:mp3_leopard_horse ndst 147456 0x2eab348  <-  19901 0x2ea657c
> trace:mpeg3:mp3_leopard_horse First 16 bytes to input:
> "\x00\x1f\x84\n\x92_\x81h\x00\x00\x00\x00\x00\x00\x00\x00"
> trace:mpeg3:mp3_leopard_horse Invalid header at 0x2ea657c
>
>
> I was also under the impression that a single input stream could come
> through as a series of ACMDM_STREAM_CONVERT messages that may or may not
> align as containing full packets or have a header on each call. This may not
> be what is happening here since it appear to be happening at the beginning
> of a given sound clip.
>
> But that is why I used the AudioFileStream (that and i was seeing apple
> documentation recommending so)
>
> -aric
>
> Kristofer Henriksson wrote:
>>
>> The current winemp3.acm does not work if the Mac-specific code is
>> used. This rewrites the relevant portion to fix, for example,
>> background music on things like Oblivion.
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>
>
>



More information about the wine-patches mailing list