Solved was RE: [vorbis-dev] Bug in vorbisfile.c?

Brian Hook brianhook at pyrogon.com
Thu Mar 21 19:03:59 PST 2002



I'm not sure if this is a bug or not, but the reason this happened is
that I was asking for a non-stereo-integral amount of data.

Specifically, my input buffer was 4410 bytes, or 50ms of 22050/16-bit
data.  No big deal -- other than it doesn't have matching stereo pairs
=)  It's obvious once you know to look for it, but it took me some head
scratching to sort out what was going on.

Moving my buffer to 4412 bytes (or exactly 1103 stereo sample pairs)
fixed that problem for me.

Brian

> -----Original Message-----
> From: owner-vorbis-dev at xiph.org 
> [mailto:owner-vorbis-dev at xiph.org] On Behalf Of Brian Hook
> Sent: Thursday, March 21, 2002 6:53 PM
> To: vorbis-dev at xiph.org
> Subject: [vorbis-dev] Bug in vorbisfile.c?
> 
> 
> I'm using RC1 right now (I think...switching to the new stuff 
> would impact my code pretty badly I think, which is why I 
> haven't bothered changing over).
> 
> Anyway, I'm hitting an infinite loop and I don't know if this 
> is me screwing up or a bug in vorbis -- it only happens on my 
> PowerMac (OS X), and only when I made some changes recently 
> to the rest of my code base.
> 
> The code is in ov_read, where it does this:
> 
> if ( samples>length/bytespersample) samples = length/bytespersample;
> 
> I call the function with "length" 2.  samples is set to 32, 
> and bytespersample is 4 (words*channels=2*2), which evaluates to:
> 
> if ( 32 > 0 ) samples = 0;
> 
> So samples is set to "0", and thus ov_read will always return 
> 0 with that particular input.
> 
> Is this a result of me doing something wrong/not 
> understanding how it's supposed to work, or is it an actual bug?
> 
> Thanks,
> 
> Brian
> 
> P.S. Forgot to mention, but Candy Cruncher is out for Linux 
> and uses Ogg Vorbis again....we've also got builds working 
> (but not released) for MacOS and BeOS
> 
> 
> --- >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.
> 
> 

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