[vlc-devel] [PATCH] Patch to fix bug #1532, and improve http seek times.
fenrir at via.ecp.fr
Mon Jun 16 20:24:09 CEST 2008
On Mon, Jun 16, 2008, Bill C. Riemers wrote:
> Laurent Aimar wrote:
> > On Fri, Jun 13, 2008, Bill C. Riemers wrote:
> >> I guess I simply don't understand how CAN_FASTSEEK is supposed to be
> >> used. But it is pretty clear from this discussion, that AVI's
> >> demux'ing is not an instance when FASTSEEK is needed. Seek times on
> >> the order of 3x ping times is good enough for avi demux. So I will
> >> correct the patch not to mark http has fastseek, and modify avi demux
> >> not to require fast seek.
> > At start, FAST_SEEK was supposed to help demuxer choose their policy to
> > read the data, stating that seeking too much will destroy performance.
> > The avi demuxer will either:
> > - seek for each sample when FAST_SEEK is true.
> > - try to read data as they come when FAST_SEEK is not defined. It should
> > work on correctly interleaved data but yes it is not perfect. Seeking should
> > still be allowed (when requested by the user).
> > - when both FAST_SEEK and SEEK are false, I think it uses the same code
> > than !FASt_SEEK without allowing the user to seek.
> In that case, the seek enhancement for http would obsolete the need for
> such a policy decision. Just always request the seek, and the
> thresholds determine if that seek is accomplished by just continuing to
> read the data stream, or by taking some action to change the seek
> position. The biggest problem with seeking is backwards seeking. The
> only way I know of to efficiently handle streams that wish to frequently
> seek backwards is to block level cache. Basically for block level
> caching, you treat each file like it is logically a set of blocks, and
> you store the most recently read blocks so there is no need to reread
> data just because of a backwards seek.
The stream layer (src/input/stream.c) already has such optimisations but may
need a review and probably be more run time configurable.
> However, I would hope that no-one would be insane enough to write video
> codecs that require frequent backward seeks to demux.
Mouarf, how naive ;)
In .avi and .mp4 you can have a file where all the video is at the start of
the file and all the audio at the end (I have seen such files) ...
More information about the vlc-devel