[Vorbis-dev] predictability of buffer size for decoding

Steve Russell srussell at innernet.net
Tue Nov 1 12:41:45 PST 2005


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.

 char* m_pDataVorbis;
 . . .
 OggVorbis_File vf;
 . . .
 vorbis_info* vi = ov_info(&vf,-1);
 . . .
int pcmTotal = ov_pcm_total(&vf, -1);
m_pDataVorbis =  new char[pcmTotal * vi->channels * 2];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20051101/33d6782e/attachment.html


More information about the Vorbis-dev mailing list