mad_stream_skip to seek to a new frame

View: New views
2 Messages — Rating Filter:   Alert me  

mad_stream_skip to seek to a new frame

by cab-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



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?

Re: mad_stream_skip to seek to a new frame

by Rob Leslie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 8, 2007, at 12:21 AM, www.bigcab@... 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
rob@...



LightInTheBox - Buy quality products at wholesale price