Some FLAC decoder cleanups

Torbjörn Andersson torbjorn.e.andersson at
Fri Nov 16 02:35:04 EST 2001

I've made a few cleanups to the FLAC decoder. I hope they will add some 
robustness. (Or not. I'm not sure. :-)

I've moved the MIDI decoder back to the end of the decoders[] array 
because it's too greedy to tell good input from bad. (I really need to 
look into beating TiMidity into submission like I've promived...)

I've changed the decoder to include FLAC/stream_decoder.h instead of 
FLAC/all.h. Does that mean that should be changed as well?

I've removed the explicit test to see if the input appears to be FLAC 
data becuase I'm hoping that the check for metadata will automagically 
weed out all bad input. I'm not sure about this.

Finally, can anyone explain this transcript?

     Sound_SetError("SHN: Not a SHN file");
     FLAC: Metadata callback.
     FLAC: Metadata is streaminfo.
     FLAC: Metadata callback.
     FLAC: Accepting data stream.
     New sample DESIRED format: S16MSB format, 44100 rate, 2 channels.
     New sample ACTUAL format: S16MSB format, 44100 rate, 2 channels.
     On-the-fly conversion: DISABLED.
     Now playing []...
     Error in decoding sound file!
       reason: [SHN: Not a SHN file].

Why is it the SHN error that survives as the reason the file is not 
decoded, and not the FLAC__STREAM_DECODER_ERROR_LOST_SYNC one? I have no 
idea at all.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flac.diff.gz
Type: application/x-gzip
Size: 1607 bytes
Desc: not available
URL: <>

More information about the sdlsound mailing list