mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
Merge commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115'
* commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115': dashenc: default to one AdaptationSet per stream Merged-by: Rodger Combs <rodger.combs@gmail.com>
This commit is contained in:
commit
3f7a8bb67b
@ -413,26 +413,15 @@ static int parse_adaptation_sets(AVFormatContext *s)
|
|||||||
enum { new_set, parse_id, parsing_streams } state;
|
enum { new_set, parse_id, parsing_streams } state;
|
||||||
AdaptationSet *as;
|
AdaptationSet *as;
|
||||||
int i, n, ret;
|
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) {
|
if (!p) {
|
||||||
for (n = 0; types[n] != AVMEDIA_TYPE_UNKNOWN; n++) {
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
int as_idx = 0;
|
if ((ret = add_adaptation_set(s, &as, s->streams[i]->codecpar->codec_type)) < 0)
|
||||||
|
return ret;
|
||||||
|
snprintf(as->id, sizeof(as->id), "%d", i);
|
||||||
|
|
||||||
for (i = 0; i < s->nb_streams; i++) {
|
c->streams[i].as_idx = c->nb_as;
|
||||||
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;
|
|
||||||
|
|
||||||
snprintf(as->id, sizeof(as->id), "%d", i);
|
|
||||||
}
|
|
||||||
c->streams[i].as_idx = as_idx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user