[FFmpeg-devel] [PATCH] http: add the seek option to disable seeking.
Michael Niedermayer
michaelni at gmx.at
Wed May 23 15:06:40 CEST 2012
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?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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/20120523/e0a0cdf3/attachment.asc>
More information about the ffmpeg-devel
mailing list