[vorbis-dev] CVS, etc...

Jeff Smith whydoubt at hotmail.com
Thu Mar 1 23:58:55 PST 2001



  I apologize for posting to both groups.  I knew which to send it to, but I 
somehow missed that little thing.  So much for first impressions.
  Thanks for the hints about Reverse DNS.  I will check that out soon.
  I didn't know how you wanted the patch, so I am just inserting the diff 
output here.  If you need something different (or for future reference), let 
me know.

24c24
< 	(((buf)[3]<<24)|((buf)[2]<<16)|((buf)[1]<<8)|((buf)[0]&0xff));

---
>	(((buf)[3]<<24)|((buf)[2]<<16)|((buf)[1]<<8)|((buf)[0]&0xff))
27c27
< 	(((buf)[1]<<8)|((buf)[0]&0xff));
---
>	(((buf)[1]<<8)|((buf)[0]&0xff))
30c30
< 	(((buf)[0]<<24)|((buf)[1]<<16)|((buf)[2]<<8)|((buf)[3]&0xff));
---
>	(((buf)[0]<<24)|((buf)[1]<<16)|((buf)[2]<<8)|((buf)[3]&0xff))
33c33
< 	(((buf)[0]<<8)|((buf)[1]&0xff));
---
>	(((buf)[0]<<8)|((buf)[1]&0xff))
337c337
< 	unsigned char buf[16];
---
>	unsigned char buf[18];
352,353c352
< 	if(len!=16)
< 	{
---
>	if ((len!=16) && (len!=18)) {
358,359c357
< 	if(fread(buf,1,16,in) < 16)
< 	{
---
>	if(fread(buf,1,len,in) < len) {
369a368,371
>	if ((len==18) && (READ_U16_LE(buf+16)!=0)) {
>		fprintf(stderr, "Warning: Unrecognised format chunk in WAV header\n");
>		return 0;
>	}

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.

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.
    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.

  - Hope I didn't get too wordy
  - Jeff Smith
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.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-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