| 1721 | } |
| 1722 | |
| 1723 | static int open_input(DASHContext *c, struct representation *pls, struct fragment *seg) |
| 1724 | { |
| 1725 | AVDictionary *opts = NULL; |
| 1726 | char *url = NULL; |
| 1727 | int ret = 0; |
| 1728 | |
| 1729 | url = av_mallocz(c->max_url_size); |
| 1730 | if (!url) { |
| 1731 | ret = AVERROR(ENOMEM); |
| 1732 | goto cleanup; |
| 1733 | } |
| 1734 | |
| 1735 | if (seg->size >= 0) { |
| 1736 | /* try to restrict the HTTP request to the part we want |
| 1737 | * (if this is in fact a HTTP request) */ |
| 1738 | av_dict_set_int(&opts, "offset", seg->url_offset, 0); |
| 1739 | av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size, 0); |
| 1740 | } |
| 1741 | |
| 1742 | ff_make_absolute_url(url, c->max_url_size, c->base_url, seg->url); |
| 1743 | av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset %"PRId64"\n", |
| 1744 | url, seg->url_offset); |
| 1745 | ret = open_url(pls->parent, &pls->input, url, &c->avio_opts, opts, NULL); |
| 1746 | |
| 1747 | cleanup: |
| 1748 | av_free(url); |
| 1749 | av_dict_free(&opts); |
| 1750 | pls->cur_seg_offset = 0; |
| 1751 | pls->cur_seg_size = seg->size; |
| 1752 | return ret; |
| 1753 | } |
| 1754 | |
| 1755 | static int update_init_section(struct representation *pls) |
| 1756 | { |
no test coverage detected