mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
libavformat/hls: Observe Set-Cookie headers
Signed-off-by: Micah Galizia <micahgalizia@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c901627918
commit
c4c73020f4
@ -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);
|
ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
// update cookies on http response with setcookies.
|
// update cookies on http response with setcookies.
|
||||||
void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb;
|
char *new_cookies = NULL;
|
||||||
update_options(&c->cookies, "cookies", u);
|
|
||||||
|
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);
|
av_dict_set(&opts, "cookies", c->cookies, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user