summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2017-09-26 14:11:25 -0300
committerJames Almer <jamrial@gmail.com>2017-09-26 14:11:25 -0300
commit3f7a8bb67b27bd3c32f3932096033a1787405601 (patch)
tree526a7f4dbac162b54709708d5c722743cbc29a9d /libavformat
parentc0fae3ff902e772d1c98a192d982893b2e8f1105 (diff)
parentca9bc9de690258d4761a19b0df6e9c9113b80115 (diff)
Merge commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115'
* commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115': dashenc: default to one AdaptationSet per stream Merged-by: Rodger Combs <rodger.combs@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dashenc.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 7b0f6714a8..5a966fe3ad 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -413,26 +413,15 @@ static int parse_adaptation_sets(AVFormatContext *s)
enum { new_set, parse_id, parsing_streams } state;
AdaptationSet *as;
int i, n, ret;
- enum AVMediaType types[] = { AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO, AVMEDIA_TYPE_UNKNOWN };
- // default: one AdaptationSet for each media type
+ // default: one AdaptationSet for each stream
if (!p) {
- for (n = 0; types[n] != AVMEDIA_TYPE_UNKNOWN; n++) {
- int as_idx = 0;
-
- for (i = 0; i < s->nb_streams; i++) {
- if (s->streams[i]->codecpar->codec_type != types[n])
- continue;
-
- if (!as_idx) {
- if ((ret = add_adaptation_set(s, &as, types[n])) < 0)
- return ret;
- as_idx = c->nb_as;
+ for (i = 0; i < s->nb_streams; i++) {
+ if ((ret = add_adaptation_set(s, &as, s->streams[i]->codecpar->codec_type)) < 0)
+ return ret;
+ snprintf(as->id, sizeof(as->id), "%d", i);
- snprintf(as->id, sizeof(as->id), "%d", i);
- }
- c->streams[i].as_idx = as_idx;
- }
+ c->streams[i].as_idx = c->nb_as;
}
goto end;
}