Hey guys, I've finished my work on reading vorbis files (straight reading at either PCM sample lengths, or time lengths). However, I've run across a question. When you call vorbis_synthesis_read, I assume that increments the internal ptrs so you don't get the same data twice. The question is, what happens if you call vorbis_synthesis and vorbis_synthesis_blockin? Does the next call have what SHOULD be the next PCM data, or has it incidentally been invalidated? A little simpler, is it safe to load another page packet and decode while there is still pcm data waiting? Thanks, Christopher
On 6/23/05, Christopher Egner <disciplezero-nl@syrrax.com> wrote:> Hey guys, > > I've finished my work on reading vorbis files (straight reading at either > PCM sample lengths, or time lengths). However, I've run across a question. > When you call vorbis_synthesis_read, I assume that increments the internal > ptrs so you don't get the same data twice. The question is, what happens if > you call vorbis_synthesis and vorbis_synthesis_blockin? Does the next call > have what SHOULD be the next PCM data, or has it incidentally been > invalidated? A little simpler, is it safe to load another page packet and > decode while there is still pcm data waiting?I wouldn't expect this to be safe, though it may be. Should be easy to check, if it doesn't work, then it isn't safe! It doesn't really seem like a very useful thing to do, though. If you want to buffer decoded data, why not just buffer it externally to libvorbis (probably after converting to the sample format you want to use)? Mike
On Thu, Jun 23, 2005 at 01:35:21PM -0500, Christopher Egner wrote:> Hey guys, > > I've finished my work on reading vorbis files (straight reading at either > PCM sample lengths, or time lengths). However, I've run across a question. > When you call vorbis_synthesis_read, I assume that increments the internal > ptrs so you don't get the same data twice. The question is, what happens if > you call vorbis_synthesis and vorbis_synthesis_blockin?It returns OV_EINVAL. You have to read out the previous block before submitting a new one. Monty