X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtmphttp.c;h=ef6146ca8640eaa13ca9c374f9553702e13b10d3;hb=b9f2f93261548f7cfdfc7a4040b23baed11e5554;hp=31f5d43232847621a73225a2663ae806c40fd066;hpb=e5c79cd854922693c80155a1744c9e93f54bce02;p=ffmpeg diff --git a/libavformat/rtmphttp.c b/libavformat/rtmphttp.c index 31f5d432328..ef6146ca864 100644 --- a/libavformat/rtmphttp.c +++ b/libavformat/rtmphttp.c @@ -208,7 +208,7 @@ static int rtmp_http_open(URLContext *h, const char *uri, int flags) } /* alloc the http context */ - if ((ret = ffurl_alloc(&rt->stream, url, AVIO_FLAG_READ_WRITE, NULL)) < 0) + if ((ret = ffurl_alloc(&rt->stream, url, AVIO_FLAG_READ_WRITE, &h->interrupt_callback)) < 0) goto fail; /* set options */ @@ -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", };