made with persistent connections to prevent incorrect reset of offset when demuxing HLS+FMP4
Unified · Split
| @@ -594,7 +594,7 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url · 593 unmodified lines | ||
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | static int open_url_keepalive(AVFormatContext *s, AVIOContext **pb, |
| 597 | − const char *url) | |
| 597 | + const char *url, AVDictionary **options) | |
| 598 | 598 | { |
| 599 | 599 | #if !CONFIG_HTTP_PROTOCOL |
| 600 | 600 | return AVERROR_PROTOCOL_NOT_FOUND; |
| @@ -603,7 +603,7 @@ static int open_url_keepalive(AVFormatContext *s, AVIOContext **pb, · 2 unmodified lines | ||
| 603 | 603 | URLContext *uc = ffio_geturlcontext(*pb); |
| 604 | 604 | av_assert0(uc); |
| 605 | 605 | (*pb)->eof_reached = 0; |
| 606 | − ret = ff_http_do_new_request(uc, url); | |
| 606 | + ret = ff_http_do_new_request2(uc, url, options); | |
| 607 | 607 | if (ret < 0) { |
| 608 | 608 | ff_format_io_close(s, pb); |
| 609 | 609 | } |
| @@ -656,7 +656,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, · 46 unmodified lines | ||
| 656 | 656 | av_dict_copy(&tmp, opts2, 0); |
| 657 | 657 | |
| 658 | 658 | if (is_http && c->http_persistent && *pb) { |
| 659 | − ret = open_url_keepalive(c->ctx, pb, url); | |
| 659 | + ret = open_url_keepalive(c->ctx, pb, url, &tmp); | |
| 660 | 660 | if (ret == AVERROR_EXIT) { |
| 661 | 661 | av_dict_free(&tmp); |
| 662 | 662 | return ret; |
| @@ -714,7 +714,7 @@ static int parse_playlist(HLSContext *c, const char *url, · 51 unmodified lines | ||
| 714 | 714 | |
| 715 | 715 | if (is_http && !in && c->http_persistent && c->playlist_pb) { |
| 716 | 716 | in = c->playlist_pb; |
| 717 | − ret = open_url_keepalive(c->ctx, &c->playlist_pb, url); | |
| 717 | + ret = open_url_keepalive(c->ctx, &c->playlist_pb, url, NULL); | |
| 718 | 718 | if (ret == AVERROR_EXIT) { |
| 719 | 719 | return ret; |
| 720 | 720 | } else if (ret < 0) { |