Re: mad_stream_skip to seek to a new frame

Rob Leslie <[email protected]> Tue, 19 Jun 2007 09:32:20 -0700
Newsgroups gmane.comp.audio.mad.devel
Message-ID <[email protected]>
On Jun 8, 2007, at 12:21 AM, [email protected] wrote:
> I think I can use mad_stream_skip to seek a new frame but I always  
> got a lost sync error
>
> I don't understand?

mad_stream_skip() is useful for skipping objects within the stream  
that have a known size, such as ID3 tags. It works by ignoring the  
specified number of bytes in the stream, even if they span multiple  
buffers.

For general seeking, you can simply pass a new buffer to  
mad_stream_buffer() at the point you wish to resume decoding. Note  
that an initial sync error is completely normal and benign.

-- 
Rob Leslie
[email protected]