[flac-dev] About Decode Streaming

Ben Allison benski at winamp.com
Tue Jul 2 08:02:12 PDT 2013


The read callback can take as long as it wants (it's blocking, after all).

It's almost definitely something wrong with your read callback code. 
Without the full source, it's hard to know exactly what.

A few guesses, in no particular order.

1) Maybe you are reading in a loop and forgetting to increment the byte
buffer pointer (continuously writing to the beginning of the buffer)

2) Maybe you are forgetting to set *bytes on output, or are writing an
incorrect value

3) Maybe you are returning something other than
FLAC__STREAM_DECODER_READ_STATUS_CONTINUE



> Yes, I have tried plain wav data with file and stream functions of decoder
> and encoder. They work succesfully.
> You're right about FLAC can't find the first block in stream, because I
> didn't add any metadata in stream. The documentation of FLAC says that
> metadata callback function is optional for stream function of decoder, so
> I
> didn't need adding metadata.
>
> Actually, I am sure about network data transferring is good, there is no
> problem, i have tested so much and observed all data has transmitted at
> every time. I suspend that sync problem occurs from network latency.
> Do you have any idea about this? If read callback may sleep or process
> more
> than excepted time, does sync lost?



More information about the flac-dev mailing list