[vorbis] Alpha

Kenneth C. Arnold kcarnold at yahoo.com
Fri Jul 28 16:47:05 PDT 2000



On Fri, Jul 28, 2000 at 03:34:11PM +1000, Michael Smith wrote:
> That's likely not the only problem on Alpha - the wav header reading code
> will only work on 32 bit/little endian machines (i.e. x86, and likely not
> much else). It's unportable code even there, since it relies heavily on the
> compiler not struct padding.

Ouch! I took some ideas from mpg123's wav.c:

truct
{
   byte riffheader[4];
   byte WAVElen[4];
   struct
   {
      byte fmtheader[8];

[...]
   } WAVE;
} RIFF =
{  { 'R','I','F','F' } , { sizeof(RIFF.WAVE),0,0,0 } ,
   {  { 'W','A','V','E','f','m','t',' ' } , { sizeof(RIFF.WAVE.fmt),0,0,0} ,
      { {1,0} , {0,0},{0,0,0,0},{0,0,0,0},{0,0},{0,0} } ,
      { { 'd','a','t','a' }  , {0,0,0,0} }
   }
};

... and later:

   fwrite(&RIFF, sizeof(RIFF),1,wavfp);

Odd that padding doesn't break mpg123 ;)

But mpg123 uses a mess of "longtolittleendian" to resolve endian issues;
there must be a cleaner way to do this.

Kenneth

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list