   mp3 decoder output buffer size
  So I've got a working mp3 decoder set up using libmad and OpenAL.  It streams from a file and plays back decently.  Problem is it's a very messy method I'm using because of the way libmad decodes.  I have a fixed input buffer of 0x10000 bytes, but I don't know what size the pcm output is going to be, so I'm storing each decoded frame in a linked-list node and then compacting them to a single buffer once I'm ready to pass the data to OpenAL.  Windows gets jittery with it every once in a while and obviously it's a lot of uneccessary overhead that I'd like to get rid of.So what I'm asking is, how can I determine what the largest possible pcm output size is based on the size of my input buffer?  What's the largest possible ratio?  (Since I'll probably change the size of my input buffer later.)  If I can set a simple output buffer then this thing will work a lot better and be a lot prettier.   
  I found the answer to this, for anyone that runs into the same problem.  The compression ratio is determined by the mp3's bitrate.  To ratio of input to output length is:1411.2 / mp3 bitrate = xinput buffer length = ysafe output buffer length = y * ((int)x + 1)Apparently 1411.2 is the bit rate of stereo 16-bit PCM data at 44.1 khz. (CD audio)For ISO compliance a decoder needs to be able to handle up to 320 kbit/s, which would be approximately a 4.41:1 compression ratio.  An output buffer 5x that size would be safe.  The lowest ISO required bit rate, 32 kbit/s, would be appx 44.1:1, so a 45x output buffer would be needed.   