[Flac-dev] Decoding without read callbacks.

Josh Coalson xflac at yahoo.com
Wed Mar 24 11:27:10 PST 2004


--- illiminable K <illiminable at westnet.com.au> wrote:
> In directshow everything is pushed into the decoder it can't ask for
> data
> when it wants... i'm just wondering if there is an alternate way to
> do
> this... is there support for this style of decoding in the underlying
> C
> library ?
> 
> Does anyone have any ideas about how i can go about doing a decode
> with only
> the output callback and no input callback ?

if it's single threaded:

I think you will have to have an intermediate buffer that is
filled by the push, and read by the read callback.  then you
have to make sure you don't call FLAC__*_process_single()
unless you know there is enough data in the buffer to make a
frame, else it will block.  you can estimate what a maximum
frame size will be using blocksize*bytes_per_sample*channels
plus a little overhead (maybe 100 bytes).

if it's multithreaded, you should be able to just block in
the FLAC read callback for more data to be pushed in.  then
you don't have to worry about having enough data before calling
FLAC__*_process_single().

Josh


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html




More information about the Flac-dev mailing list