[vorbis-dev] CVS, etc...

Michael Smith msmith at labyrinth.net.au
Sat Mar 3 17:08:21 PST 2001



>
>
>Reasoning:
>    Some programs seem to treat the 'fmt ' section of a standard, 
>uncompressed WAV slightly differently.  Some specs show an extra word, 
>cbSize, which tells how many extra bytes there are in the section.
>    This word may be thrown out with normal uncompressed WAVs, making the 
>size of the 'fmt ' section to be 16.  But these programs don't, leaving it 
>size 18.  If the data in this extra word is anything besides 0, there is an 
>inconsistency.

This extra 2 bytes isn't part of a valid PCM wav format chunk. It's not 
just different, it's completely wrong. 
However, enough programs seem to make this particular mistake that I've 
changed things - you're far from the first to point this out. 
Please, if you know of programs which are creating these invalid wav files,
send a bug report to whoever makes it. It's stupid and annoying.

>
>Specific items:
>    The ; on the macro definitions is redundant (take a look at 'gcc -E 
>audio.c' if you need more convincing).  If you do not use the macro at the 
>*very* end of a statement, it causes errors.  This change should be effected 
>regardless of whether the rest is.  But other parts of my changes rely on 
>this.

Yes - this was just a silly mistake which I'd never noticed. Harmless in the
current use, but corrected now.

>    increasing buf size from 16 to 18.  The size of the alternate header is 
>one word longer.
>    if ((len!=16) && (len!=18))  Check for both header sizes.
>    if(fread(buf,1,len,in) < len)  16 and 18 are the only possible values of 
>len, if we got this, far and we take care of both.
>    if ((len==18) && (READ_U16_LE(buf+16)!=0))  The extra word must contain 
>the data 0x0000.

I've changed this somewhat differently. We can't be expected to 
work reliably in the presence of an invalid format chunk, so it
just assumes that the bytes are 0, and prints a warning. 

Michael

--- >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-dev-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-dev mailing list