[FFmpeg-devel] [PATCH 6/9] lavf/http: add http_accept
Nicolas George
george at nsup.org
Fri Jul 3 16:00:27 CEST 2015
Le quintidi 15 messidor, an CCXXIII, Stephan Holljes a écrit :
> Signed-off-by: Stephan Holljes <klaxa1337 at googlemail.com>
> ---
> libavformat/http.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 676bfd5..d9c3624 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -25,6 +25,7 @@
> #include <zlib.h>
> #endif /* CONFIG_ZLIB */
>
> +#include "libavutil/avassert.h"
> #include "libavutil/avstring.h"
> #include "libavutil/opt.h"
>
> @@ -382,6 +383,24 @@ static int http_open(URLContext *h, const char *uri, int flags,
> return ret;
> }
>
> +static int http_accept(URLContext *s, URLContext **c)
> +{
> + int ret;
> + HTTPContext *sc = s->priv_data;
> + HTTPContext *cc;
> + URLContext *sl = sc->hd;
> + URLContext *cl;
> + av_assert0(sc->listen);
> + if ((ret = ffurl_alloc(c, s->filename, AVIO_FLAG_WRITE, &sl->interrupt_callback)) < 0)
Here too, I suspect c->flags should be used (possibly with some filtering)
instead of hardcoding the flags.
> + goto fail;
> + cc = (*c)->priv_data;
> + if ((ret = ffurl_accept(sl, &cl)) < 0)
> + goto fail;
> + cc->hd = cl;
> +fail:
> + return ret;
> +}
> +
> static int http_getc(HTTPContext *s)
> {
> int len;
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150703/55b2a5bf/attachment.asc>
More information about the ffmpeg-devel
mailing list