- Don't call mad_stream_buffer() more often than you need to. In
particular, don't call it each time you decode a frame. Only call it after you've read more data, usually after mad_frame_decode() returns MAD_ERROR_BUFLEN.
I check the return of the read is > 0 right before I call mad_stream_buffer
- Remember to copy the remaining data (from stream.next_frame to the
end of your original buffer) to the beginning of your new buffer, and append new data after that, before calling mad_stream_buffer().
I do that
Wouldnt the problem be generalized if it was such an error? up to now I was only able to find 2 songs on our whole media server at work that would have those ticks.
Thanks