Hi Adam,
I'm having trouble creating the equivalent of minimad.c, except without loading the whole file into memory. In fact, now that I have added in the error callback I seem to be having trouble doing anything at all.
Without the callback the pcm outputed has errors at the end of each BUF_SIZE chunck read in from the file. With the callback function (taken almost literally from minimad.c) the program ends on a sync. error (101) within the first frame.
Your input buffer is on the stack, and is invalid as soon as your input callback returns. The buffer you pass to mad_stream_buffer() must survive until the next call to this function, or until you stop decoding.
For a simple fix, try making your data buffer 'static'.
Cheers,