[Ffmpeg-devel] Re: [PATCH] mov stsd audio version 2

Baptiste COUDURIER baptiste.coudurier
Sat Mar 4 00:14:18 CET 2006

Corey Hickey wrote:
> [...]
> No, I don't think this is correct. For example, 48000 Hz audio is
> 0x40E7700000000000. get_be64() uses so many left shifts the result is 0,
> but if it were read completely that way it would be 4676829883349860352.

Ah you are right.

> I'm not sure how, but if the chars were read into a double
> (endian-switched if necessary) and then cast to int it should work
> properly. Reading the value into a double is the hard part, though,
> since you can't use bitwise operators (and, even so, is a double
> universally 64-bit?). The conversion might have to be done manually.

Maybe av_int2dbl ?

> So far, the only files with the v2 atom I've seen have AAC audio and the
> samplerate stored in an esds atom. That's how mplayer gets by without
> parsing the samplerate correctly -- the esds is passed to libfaad. I
> don't know if that holds true for ffmpeg. It might be ok to not parse
> the samplerate from the stsd and try to get it from the esds instead.
> By the way, thanks a bunch for the v2 spec -- I found out that some of
> my guesses were incorrect. I'll be sending a patch for mplayer after I
> get the samplerate issue resolved (or give up).

I tried this way and it seems to be better. Patch attached. What do you
think ?

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mov_stsd_audio_2.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060304/434d6a34/attachment.asc>

More information about the ffmpeg-devel mailing list