[Vorbis] diff to vorbis-tools-1.1.1

Lars Täuber lars.taeuber at gmx.net
Mon Feb 20 13:44:12 PST 2006


Hi Ralph

> Thanks for the patch. Just to clarify, this "wav6" format has some extra 
> (constant? is there a spec) structure, and a bitflag field which 
> specifies which channels are in the file? And the channels appear is a 
> specific order?

yes there is a spec. Just google for WAVEFORMATEXTENSIBLE and take the first result from Micro$oft:
http://www.microsoft.com/whdc/device/audio/multichaud.mspx
The channels appear in a special order. Just like the significance of the bits in the channelMask: see audio.h.
When not all channels are used they are just left out.

> You forgot to update the comment above the length check at audio.c:389.

Sorry just feel free to do it yourself.

> You removed the "Deal with stupid broken apps" code. Is it safe to do
> this? Maybe it's just me; I'm not clear whether the new code handles
> what is left of that case.

Yes, I think it's safe to remove this, because it was code to read just two more bytes from the file when the length field told not 16 but 18 bytes to read. I exchanged the fix-length-read from 16 bytes to "len" number of bytes.
-	if(fread(buf,1,16,in) < 16)
+	if(fread(buf,1,len,in) < len)

With my code this length field can become even 40 (for WAVEFORMATEXTENSIBLE) or greater and we read it as it told us to do.


> "if(~format.format == 1)" seems a little obscure. Wouldn't 
> "if(format.format == ~1)" or even "if(format.format == 0xFFFE)"
> be more clear?

I tried just the least version, but in my case "format.format" was 0xFFFFFFFE after a READ_U16_LE of "FE FF" and therefor never equal to 0xFFFE. I don't know why. Maybe my compiler version doesn't work as expected. Or the READ_U16_LE has some influence on this case. How long is a "short int" under Linux i386?

> You define a bunch of speaker orientation flags in audio.h, but don't 
> use them anywhere. I also don't see any attempt to map the channels into 
> the order given in the vorbis spec. If the wav6 order is the same, this 
> should probably be documented in a comment.

OK, my fault. The channelMask is the bit mask of all the channels appearing in the stream. I just put the same order into the ogg file. I didn't find any documentation about the channel ordering in an ogg file.
This patch was only an attempt to provoke some more skilled programmer to complete this first work.

I have heard about the besweet programm for window$ that is told to be able to encode mutlichannel ogg vorbis. Obviously the programmers there should know much better than me.

>  -r
> 

Best Regards
Lars


PS: Sorry for my english.


More information about the Vorbis mailing list