aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicah Galizia <micahgalizia@gmail.com>2017-05-30 21:29:55 -0400
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-02 01:14:38 +0200
commite5e01d24773dde50159df2ad616f3e16a8d2a650 (patch)
treed839652d3581e18cc66ee5d73d76eb952f4ec444
parent771206c0dbb4761307bdfc0a9f0a98b694d58a31 (diff)
downloadffmpeg-e5e01d24773dde50159df2ad616f3e16a8d2a650.tar.gz
libavformat/hls: Observe Set-Cookie headers
Signed-off-by: Micah Galizia <micahgalizia@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c4c73020f4bbf261f0b263be82de575c17fa5a60) Signed-off-by: Micah Galizia <micahgalizia@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/hls.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index bac53a4350..42022690f1 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -630,8 +630,16 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
if (ret >= 0) {
// update cookies on http response with setcookies.
- void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb;
- update_options(&c->cookies, "cookies", u);
+ char *new_cookies = NULL;
+
+ if (!(s->flags & AVFMT_FLAG_CUSTOM_IO))
+ av_opt_get(*pb, "cookies", AV_OPT_SEARCH_CHILDREN, (uint8_t**)&new_cookies);
+
+ if (new_cookies) {
+ av_free(c->cookies);
+ c->cookies = new_cookies;
+ }
+
av_dict_set(&opts, "cookies", c->cookies, 0);
}