MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / open_input

Function open_input

libavformat/dashdec.c:1723–1753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1721}
1722
1723static 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
1747cleanup:
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
1755static int update_init_section(struct representation *pls)
1756{

Callers 2

update_init_sectionFunction · 0.70
read_dataFunction · 0.70

Calls 7

av_dict_set_intFunction · 0.85
ff_make_absolute_urlFunction · 0.85
av_logFunction · 0.85
av_dict_freeFunction · 0.85
open_urlFunction · 0.70
av_malloczFunction · 0.50
av_freeFunction · 0.50

Tested by

no test coverage detected