[MPlayer-dev-eng] Re: [PATCH] Seek in http-streams

Alban Bedel albeu at free.fr
Sat Jan 10 15:29:42 CET 2004


Hi Valentine Zaretsky,

on Sat, 10 Jan 2004 15:46:42 +0200 you wrote:

> Hi!
> 
> This patch allows to seek in http-stream if server supports partial
> content requests (ranges).
> Patch is rather simple.

I implemented that once, but lost it in an rm -rf accident with lot's
of other stuff mplayer :(((
 
> Changes are:
> - http_send_request extended to be able to send Range: header if needed

I prefer to change http_send_request and the 2 or 3 place where it's
called rather than adding a new global function. But that's a matter of
taste i think ;)

> - type of the second argument in streaming_seek callback of 
> streaming_ctrl_t structure has been changed to stream_t* (from 
> streaming_ctrl_t*) because we need new to open new connection in order 
> to seek on http and thus close old stream->fd and assign new one, so 
> streaming_ctrl_t is not enough

I don't really like the idea of changing all these callbacks, etc
You can use dup2 to continue to use the old fd.
Dunno however if that will work on win32 and other fancy os.

> - new http_streaming_seek function doing the main job

I have a few other remarks. First note that stream seeking caps.
is normaly indicated in the stream flags. So you should rather use
that instead of the ugly STREAM_SEEKABLE() define.
Ihmo you should only modify autodetectProtocol to make it return
a different value if the stream is seekable. Then the seek callback
can just be set in streaming_start. No need for an extra field in
streaming_ctrl_t.

	Albeu

-- 

Everything is controlled by a small evil group
to which, unfortunately, no one we know belongs.





More information about the MPlayer-dev-eng mailing list