On Tuesday, November 5, 2002, at 10:39 AM, Eric Lyons wrote:
I'm trying to figure out how to tell the decoding process to flush the input buffer after a MAD_FLOW_STOP is returned from decode_input_read (in madplay.c).
It stops playing fine, but when I decode() again, it picks up from where it left off in the buffer. I want to retain this behavior too, but also have the ability to kill the current buffer when it restarts.
Is this not possible with the high-level API? Perhaps I can add a MAD_FLOW_FLUSH?
Before you start decoding again, if you want to decode something different, you should call mad_stream_buffer() to reset the stream location. You may also want to reset the internal decoding state by calling mad_frame_mute() and mad_synth_mute().