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

Function dash_read_header

libavformat/dashdec.c:2064–2184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2062}
2063
2064static int dash_read_header(AVFormatContext *s)
2065{
2066 DASHContext *c = s->priv_data;
2067 struct representation *rep;
2068 AVProgram *program;
2069 int ret = 0;
2070 int stream_index = 0;
2071 int i;
2072
2073 c->interrupt_callback = &s->interrupt_callback;
2074
2075 if ((ret = ffio_copy_url_options(s->pb, &c->avio_opts)) < 0)
2076 return ret;
2077
2078 if ((ret = parse_manifest(s, s->url, s->pb)) < 0)
2079 return ret;
2080
2081 /* If this isn't a live stream, fill the total duration of the
2082 * stream. */
2083 if (!c->is_live) {
2084 s->duration = (int64_t) c->media_presentation_duration * AV_TIME_BASE;
2085 } else {
2086 av_dict_set(&c->avio_opts, "seekable", "0", 0);
2087 }
2088
2089 if(c->n_videos)
2090 c->is_init_section_common_video = is_common_init_section_exist(c->videos, c->n_videos);
2091
2092 /* Open the demuxer for video and audio components if available */
2093 for (i = 0; i < c->n_videos; i++) {
2094 rep = c->videos[i];
2095 if (i > 0 && c->is_init_section_common_video) {
2096 ret = copy_init_section(rep, c->videos[0]);
2097 if (ret < 0)
2098 return ret;
2099 }
2100 ret = open_demux_for_component(s, rep);
2101
2102 if (ret)
2103 return ret;
2104 if (rep->ctx->nb_streams == 0)
2105 return AVERROR_PATCHWELCOME;
2106 rep->stream_index = stream_index;
2107 ++stream_index;
2108 }
2109
2110 if(c->n_audios)
2111 c->is_init_section_common_audio = is_common_init_section_exist(c->audios, c->n_audios);
2112
2113 for (i = 0; i < c->n_audios; i++) {
2114 rep = c->audios[i];
2115 if (i > 0 && c->is_init_section_common_audio) {
2116 ret = copy_init_section(rep, c->audios[0]);
2117 if (ret < 0)
2118 return ret;
2119 }
2120 ret = open_demux_for_component(s, rep);
2121

Callers

nothing calls this directly

Calls 10

ffio_copy_url_optionsFunction · 0.85
parse_manifestFunction · 0.85
av_dict_setFunction · 0.85
copy_init_sectionFunction · 0.85
open_demux_for_componentFunction · 0.85
av_new_programFunction · 0.85
av_dict_set_intFunction · 0.85
move_metadataFunction · 0.85

Tested by

no test coverage detected