Skip to content
Snippets Groups Projects
Commit 95f1004b authored by Peter Große's avatar Peter Große Committed by Martin Storsjö
Browse files

dashenc: add mandatory id to AdaptationSet and Period in manifest


Signed-off-by: default avatarPeter Große <pegro@friiks.de>
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 1ae6cb7d
No related branches found
No related tags found
No related merge requests found
...@@ -439,7 +439,7 @@ static int write_manifest(AVFormatContext *s, int final) ...@@ -439,7 +439,7 @@ static int write_manifest(AVFormatContext *s, int final)
DASHContext *c = s->priv_data; DASHContext *c = s->priv_data;
AVIOContext *out; AVIOContext *out;
char temp_filename[1024]; char temp_filename[1024];
int ret, i; int ret, i, as_id = 0;
AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0); AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
snprintf(temp_filename, sizeof(temp_filename), "%s.tmp", s->filename); snprintf(temp_filename, sizeof(temp_filename), "%s.tmp", s->filename);
...@@ -494,15 +494,15 @@ static int write_manifest(AVFormatContext *s, int final) ...@@ -494,15 +494,15 @@ static int write_manifest(AVFormatContext *s, int final)
OutputStream *os = &c->streams[0]; OutputStream *os = &c->streams[0];
int start_index = FFMAX(os->nb_segments - c->window_size, 0); int start_index = FFMAX(os->nb_segments - c->window_size, 0);
int64_t start_time = av_rescale_q(os->segments[start_index]->time, s->streams[0]->time_base, AV_TIME_BASE_Q); int64_t start_time = av_rescale_q(os->segments[start_index]->time, s->streams[0]->time_base, AV_TIME_BASE_Q);
avio_printf(out, "\t<Period start=\""); avio_printf(out, "\t<Period id=\"0\" start=\"");
write_time(out, start_time); write_time(out, start_time);
avio_printf(out, "\">\n"); avio_printf(out, "\">\n");
} else { } else {
avio_printf(out, "\t<Period start=\"PT0.0S\">\n"); avio_printf(out, "\t<Period id=\"0\" start=\"PT0.0S\">\n");
} }
if (c->has_video) { if (c->has_video) {
avio_printf(out, "\t\t<AdaptationSet contentType=\"video\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n"); avio_printf(out, "\t\t<AdaptationSet id=\"%d\" contentType=\"video\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n", as_id++);
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
OutputStream *os = &c->streams[i]; OutputStream *os = &c->streams[i];
...@@ -515,7 +515,7 @@ static int write_manifest(AVFormatContext *s, int final) ...@@ -515,7 +515,7 @@ static int write_manifest(AVFormatContext *s, int final)
avio_printf(out, "\t\t</AdaptationSet>\n"); avio_printf(out, "\t\t</AdaptationSet>\n");
} }
if (c->has_audio) { if (c->has_audio) {
avio_printf(out, "\t\t<AdaptationSet contentType=\"audio\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n"); avio_printf(out, "\t\t<AdaptationSet id=\"%d\" contentType=\"audio\" segmentAlignment=\"true\" bitstreamSwitching=\"true\">\n", as_id++);
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
OutputStream *os = &c->streams[i]; OutputStream *os = &c->streams[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment