[vlc-devel] I am reworking the http seek optimizations

Bill C. Riemers briemers at redhat.com
Tue Jun 17 21:02:54 CEST 2008

Fundamentally, the problem is either the stream needs to be changed to
be marked as FASTSEEK, or the demux needs to be changed to accept SEEK
for seeking video.   Unfortunately, there is no other solution within
this code base, and thus far I haven't gotten an agreement for either

I can understand the reason for not wanting to change http.c, or for
that matter ftp.c to be FASTSEEK.   The stream handler tries to be
clever about when it
seeks and what it caches.  By messing with that tag in the streams, the
stream handler is limited.   Lets face it, the streams should be smart
enough to collect
the data and additional optimizations should be made in the stream
handler.   With HTTP we have the option do some things the stream
handler doesn't know about, like persisting the connection, requesting
small amounts of data so we are ready to seek on that connection, an
sending asynchronous requests so we can get the data just as fast as
with large requests.   So those optimizations make sense.   But lets say
we want to read a file backwards?   To do that over http we would have
to have an effective caching strategy.  The stream handler is already
doing that, so it would not make sense to put that in the http stream. 
However, in that case the stream handler needs to know some information
about the stream, which is why there is a FASTSEEK attribute.

The fundamental flaw is this design, is the demux's should not even have
access to the FASTSEEK attribute.  If the stream handler is doing it's
job, any stream that can seek can effectively FASTSEEK through the
clever use of cache.   So the only case a demux would need to know
FASTSEEK, is if the stream handler is unable to do it's job properly.

So long term, probably the correct solution is to deny access to the
FASTSEEK attribute to the demux modules, and continue to improve
stream.c until all the different seekable stream types work as
expected.   But obviously that is a very non-trivial task, to accomplish
something that can be accomplished today simply by changing a few


Andrew Zaikin wrote:
> Bill,
> I was working on similair problem in January (the only difference was
> that my movie collection is placed on ftp, not http). I was able to
> pull into repository some enchancements for ftp plugin itself, but
> changing FASTSEEK->SEEK in libavi was blocked by Laurie with pretty
> much the same explanation. I'm using my private build with that fix
> since then trying to find such a bad avi that will be causing instant
> seek, but so far everything was working just fine ;)
> Anyway, if you are working on libavi improvments around seeks (or got
> other bright idea in this area) and need any help, I would be
> delighted to do so. I'm very interesting to switch back to normal
> latest build instead of my private one ;)
> Andy
> On Tue, Jun 17, 2008 at 1:10 AM, Bill C. Riemers <briemers at redhat.com
> <mailto:briemers at redhat.com>> wrote:
>     I decided I might as well try a few other ideas and then submit what
>     works best.
>     Bill
>     _______________________________________________
>     vlc-devel mailing list
>     To unsubscribe or modify your subscription options:
>     http://mailman.videolan.org/listinfo/vlc-devel
> ------------------------------------------------------------------------
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list