[Vorbis-dev] predictability of buffer size for decoding
Michael Smith
msmith at xiph.org
Tue Nov 1 13:59:00 PST 2005
On 11/1/05, Steve Russell <srussell at innernet.net> wrote:
>
> I am wondering if buffer size for my decoding to pcm can be predicted
> dependably as follows. So far, the one problem I have had is when I have
> played a file of only about 5k. The buffer was a little less than 10% too
> small. I "solved" that by padding the result with an extra 20 percent.
> However, I have been told that I should be able to rely on the value of
> ov_pcm_total.
Yes, ov_pcm_total will return sample-accurate accurate values for a
valid ogg stream.
It's possible to create files that will confuse it into returning the
wrong values, but those would be rare (and invalid), so I wouldn't
worry about them. Just check that you don't overrun the buffer you DID
allocate.
Mike
More information about the Vorbis-dev
mailing list