[FFmpeg-devel] [PATCH] http: add the seek option to disable seeking.

Michael Niedermayer michaelni at gmx.at
Sun Jun 3 18:34:59 CEST 2012


On Wed, May 23, 2012 at 03:06:40PM +0200, Michael Niedermayer wrote:
> On Sat, May 19, 2012 at 09:50:40PM +0200, Nicolas George wrote:
> > Some streaming servers seem to support seeking
> > but will just skip over the relevant data.
> > 
> > See trac ticket #1320.
> > 
> > Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> > ---
> >  libavformat/http.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavformat/http.c b/libavformat/http.c
> > index 2589a8f..1e59b4e 100644
> > --- a/libavformat/http.c
> > +++ b/libavformat/http.c
> > @@ -52,6 +52,7 @@ typedef struct {
> >      char *headers;
> >      int willclose;          /**< Set if the server correctly handles Connection: close and will close the connection after feeding us the content. */
> >      int chunked_post;
> > +    int enable_seek;
> >  } HTTPContext;
> >  
> >  #define OFFSET(x) offsetof(HTTPContext, x)
> > @@ -61,6 +62,7 @@ typedef struct {
> >  static const AVOption options[] = {
> >  {"chunked_post", "use chunked transfer-encoding for posts", OFFSET(chunked_post), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1, E },
> >  {"headers", "custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
> > +{"seek", "enable seeking using HTTP range feature", OFFSET(enable_seek), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1, D},
> 
> i suggest to make it tri-state
> enable-auto-disable
> and have auto as default
> 
> otherwise patch LGTM
> 
> maybe we can detect the problematic server somehow?

patch that attempts to autodetect this sent

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120603/809c7768/attachment.asc>


More information about the ffmpeg-devel mailing list