[FFmpeg-devel] [PATCH] lavf: forward protocol_whitelist for the remaining cases

Michael Niedermayer michael at niedermayer.cc
Wed Feb 3 03:41:22 CET 2016


On Wed, Feb 03, 2016 at 01:51:55AM +0100, Andreas Cadhalpun wrote:
> Also set a default_whitelist for mmsh and ffrtmphttp.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/mmsh.c     | 9 +++++++++
>  libavformat/rtmphttp.c | 9 +++++++++
>  libavformat/rtsp.c     | 8 ++++++++
>  3 files changed, 26 insertions(+)
> 
> diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
> index 16f07fe..d992337 100644
> --- a/libavformat/mmsh.c
> +++ b/libavformat/mmsh.c
> @@ -246,6 +246,14 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
>               host, port, mmsh->request_seq++);
>      av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
>  
> +    if (!mms->mms_hd->protocol_whitelist && h->protocol_whitelist) {
> +        mms->mms_hd->protocol_whitelist = av_strdup(h->protocol_whitelist);
> +        if (!mms->mms_hd->protocol_whitelist) {
> +            err = AVERROR(ENOMEM);
> +            goto fail;
> +        }
> +    }
> +
>      err = ffurl_connect(mms->mms_hd, NULL);
>      if (err) {
>          goto fail;
> @@ -410,4 +418,5 @@ URLProtocol ff_mmsh_protocol = {
>      .url_read_seek  = mmsh_read_seek,
>      .priv_data_size = sizeof(MMSHContext),
>      .flags          = URL_PROTOCOL_FLAG_NETWORK,
> +    .default_whitelist = "http,tcp",
>  };
> diff --git a/libavformat/rtmphttp.c b/libavformat/rtmphttp.c
> index 8ed5eb1..c8a15e3 100644
> --- a/libavformat/rtmphttp.c
> +++ b/libavformat/rtmphttp.c
> @@ -220,6 +220,14 @@ static int rtmp_http_open(URLContext *h, const char *uri, int flags)
>      av_opt_set(rt->stream->priv_data, "multiple_requests", "1", 0);
>      av_opt_set_bin(rt->stream->priv_data, "post_data", "", 1, 0);
>  
> +    if (!rt->stream->protocol_whitelist && h->protocol_whitelist) {
> +        rt->stream->protocol_whitelist = av_strdup(h->protocol_whitelist);
> +        if (!rt->stream->protocol_whitelist) {
> +            ret = AVERROR(ENOMEM);
> +            goto fail;
> +        }
> +    }
> +
>      /* open the http context */
>      if ((ret = ffurl_connect(rt->stream, NULL)) < 0)
>          goto fail;
> @@ -274,4 +282,5 @@ URLProtocol ff_ffrtmphttp_protocol = {
>      .priv_data_size = sizeof(RTMP_HTTPContext),
>      .flags          = URL_PROTOCOL_FLAG_NETWORK,
>      .priv_data_class= &ffrtmphttp_class,
> +    .default_whitelist = "https,http,tcp",

if it needs https it might need tls too


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160203/746d8ab8/attachment.sig>


More information about the ffmpeg-devel mailing list