[Flac-dev] about libFLAC
Daniel Souza
danielrsouza at hotmail.com
Wed Sep 19 20:07:01 PDT 2001
Hi Josh,
As you know, I'm writing a FLAC ACM codec using libFLAC. The Audio Codec
Manager sends messages to the driver with blocks of data to be converted. I
think it will be much easier to decode the data if we could use
FLAC__stream_decoder_process_whole_stream() to process the first message,
not processing any data that don't make a whole frame, and then use
FLAC__stream_decoder_process_remaining_frames() to process all remaining
messages, again not processing any data that don't make a whole frame,
except for the last message. For doing that, a possible solution could be
permit the decoder in the state FLAC__STREAM_DECODER_ABORTED to respond
FLAC__stream_decoder_process_remaining_frames() like the state
FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC. The new code in
FLAC__stream_decoder_process_remaining_frames() would be:
...
while(1) {
switch(decoder->protected->state) {
case FLAC__STREAM_DECODER_ABORTED:
case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
...
That's a suggestion, but any solution that permit us to continue a stopped
decoding will do the job. Maybe a new stopped state.
Another thing: Is there a reason for FLAC__stream_decoder_set_client_data()
and FLAC__stream_encoder_set_client_data() returning false if the state
isn't FLAC__STREAM_DECODER_UNINITIALIZED or
FLAC__STREAM_DECODER_UNINITIALIZED? I do not understand why is that, because
it has nothing to do with the encoding process (it's client data!).
Regards,
Daniel
More information about the Flac-dev
mailing list