aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-02-03 01:01:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-05 16:18:49 +0200
commita16018461b2f5c652b246a9aed1ab04623e96470 (patch)
tree7fd6ec79863f029090b69ce2e620227a51718894
parent04a8bbca9289a4ee203f90bb8d48166bf53015e6 (diff)
downloadffmpeg-a16018461b2f5c652b246a9aed1ab04623e96470.tar.gz
lavf: forward protocol_whitelist for the remaining cases
Also set a default_whitelist for mmsh and ffrtmphttp. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mmsh.c9
-rw-r--r--libavformat/rtmphttp.c9
-rw-r--r--libavformat/rtsp.c8
3 files changed, 26 insertions, 0 deletions
diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index d18e2d8061..13c0ffe438 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 @@ const 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 31f5d43232..e5ce10ca4f 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 @@ const 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,tls",
};
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 21c80c1cb0..15e1ab8395 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1752,6 +1752,14 @@ redirect:
sessioncookie);
av_opt_set(rt->rtsp_hd->priv_data, "headers", headers, 0);
+ if (!rt->rtsp_hd->protocol_whitelist && s->protocol_whitelist) {
+ rt->rtsp_hd->protocol_whitelist = av_strdup(s->protocol_whitelist);
+ if (!rt->rtsp_hd->protocol_whitelist) {
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
+ }
+
/* complete the connection */
if (ffurl_connect(rt->rtsp_hd, NULL)) {
err = AVERROR(EIO);