[Ffmpeg-devel] Re: Re: Re: [PATCH] file length handling

Ronald S. Bultje rbultje
Fri Dec 22 15:38:31 CET 2006


Hi,

I'd like to add one additional note:

On Fri, 2006-12-22 at 08:25 -0500, Ronald S. Bultje wrote:
> > i think the simplest solution would be to handle seeking in http like
> > 
> > seek(){
> >     find new position
> >     c->req_off= position
> >     return positon
> > }
> > 
> > read(){
> >     if(c->req_off != c->off){
> >         perform actual seek
> >         c->off= c->req_off;
> >     }
> >     ...
> > }
> > 
> > this would also not break compatibility though that is only a minor
> > advantage due to AVFrac ...
> 
> I don't mind doing this, I'm just not a huge fan of this asynchronous
> programming... I kind of consider this hacky.

I don't know if there's any always-right way to detect whether the
server supports range requests. It's part of HTTP 1.1, but not required.
Servers could stream live content. I currently use the HTTP header to
see if the range request worked (Content-Range: bytes %from-%to/%total),
and if I seek asynchronously, I wouldn't be able to do this anymore. I
can of course seek during the first open() and see if it works, but
that's more of a hack than anything else.

Ronald





More information about the ffmpeg-devel mailing list