On Tuesday 22 of May 2007 21:56:58 Rob Leslie wrote:
I just realized that your mpeg_buffer is on the stack. MAD doesn't copy this buffer; it keeps pointers to it. Unless you're decoding the entire file in one go, this is very likely a source of corruption and consequent decoding errors.
Try moving line 5 outside the function, to file scope.
That's it. Thank you very much. I should realize such obvious mistake but sometimes I can't see the forest for trees :-).