[vlc-devel] Re: Byte-accurate seeking in VLC

Clément Stenac zorglub at diwi.org
Fri Nov 10 13:59:27 CET 2006


Basically, the stream facility can only be used by demuxers, so, no, you
cannot use it from the access.

In your case, when you perform the seek, as you update info.i_pos, the
demuxer being unaware of the corruption, notices that the pointer is not
where it should be and orders a seek (through stream_Seek).

The correct solution is that your access module should hide the fact
that it performed a seek to skip corrupt data. This is the correct thing
to do because it is precisely the goal of your access. If your file is
300 MB, for example, the "useful size" is here 275 MB.

So, you should seek corrupt data, but not update info.i_pos, and offset
all further reads and seek requests by the amount of data skipped (if
the read/seek is after the corruption). Basically, if there are several
skips, your module should keep a list of "holes", and perform
computation of real file access, based on what has been requested.

Clément Stenac

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list