[Flac-dev] Push/Pull Model

Josh Coalson xflac at yahoo.com
Fri Feb 15 14:18:21 PST 2002


--- Ingo Ralf Blum <ingoralfblum at gmx.de> wrote:
> Hi,
> 
> The stream decoder follows a push model, however, I need a pull model
> decoder, like, for example, implemented by the Vorbis libs. For this
> I
> simply save the pointer to the audio data in the read callback and
> acces the
> data lateron after the call to FLAC__stream_decoder_process_one_frame
> returned.
> 
> Is this safe? Can I assume that the internal buffer is not freed,
> when
> FLAC__stream_decoder_process_one_frame returns, or will I have to
> copy the
> data to a temporary buffer?

the pointer libFLAC gives you in the read_callback, where
you put the encoded data to be decoded, is managed by the
library.  it may even be pointing to the middle of one of
it's internally allocated buffers.  so you can't assume it
will be there or point to the same stuff after you return
from the callback.  the same is mostly true for the write
callback.

Josh


__________________________________________________
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com




More information about the Flac-dev mailing list