Brett Paterson wrote:
It decodes the header correctly, then when decoding the data in the (stereo mp3) file, it goes into an infinite loop inside mad_frame_decode.
Maybe I didnt set the project up properly, all I did was create a new project in devstudio, add all the mad files, then defined FPM_DEFAULT,OPT_SPEED in my project. Is there anything else I should be doing?
The problem is in huffman.c. Currently, this uses a GNU extension to initialize a union member other than the first. I'm surprised you were able to compile this file without making changes to it.
I'll be releasing a new version of MAD soon which makes the code more portable to non-GCC compilers. It will also include MSVC++ project files.
Until then, you'll need to find a workaround for the union initializations in huffman.c.
Cheers, -rob