lavf/webmdashenc: Representation IDs should be unique.

According to the DASH spec, Representation IDs should be unique
across all adaptation sets. Fixing that and updating the fate
reference file to reflect this change.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/95/head
Vignesh Venkatasubramanian 10 years ago committed by Michael Niedermayer
parent dadc1f5ee9
commit 597d826123
  1. 3
      libavformat/webmdashenc.c
  2. 4
      tests/ref/fate/webm-dash-manifest

@ -46,6 +46,7 @@ typedef struct WebMDashMuxContext {
char *adaptation_sets; char *adaptation_sets;
AdaptationSet *as; AdaptationSet *as;
int nb_as; int nb_as;
int representation_id;
} WebMDashMuxContext; } WebMDashMuxContext;
static const char *get_codec_name(int codec_id) static const char *get_codec_name(int codec_id)
@ -259,7 +260,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index)
avio_printf(s->pb, ">\n"); avio_printf(s->pb, ">\n");
for (i = 0; i < as->nb_streams; i++) { for (i = 0; i < as->nb_streams; i++) {
write_representation(s, s->streams[as->streams[i]], i, write_representation(s, s->streams[as->streams[i]], w->representation_id++,
!width_in_as, !height_in_as, !sample_rate_in_as); !width_in_as, !height_in_as, !sample_rate_in_as);
} }
avio_printf(s->pb, "</AdaptationSet>\n"); avio_printf(s->pb, "</AdaptationSet>\n");

@ -27,7 +27,7 @@
</Representation> </Representation>
</AdaptationSet> </AdaptationSet>
<AdaptationSet id="1" mimeType="audio/webm" codecs="vorbis" lang="eng" audioSamplingRate="44100" bitstreamSwitching="true" subsegmentAlignment="false" subsegmentStartsWithSAP="1"> <AdaptationSet id="1" mimeType="audio/webm" codecs="vorbis" lang="eng" audioSamplingRate="44100" bitstreamSwitching="true" subsegmentAlignment="false" subsegmentStartsWithSAP="1">
<Representation id="0" bandwidth="82867"> <Representation id="2" bandwidth="82867">
<BaseURL>dash_audio1.webm</BaseURL> <BaseURL>dash_audio1.webm</BaseURL>
<SegmentBase <SegmentBase
indexRange="335488-335612"> indexRange="335488-335612">
@ -35,7 +35,7 @@
range="0-4103" /> range="0-4103" />
</SegmentBase> </SegmentBase>
</Representation> </Representation>
<Representation id="1" bandwidth="82814"> <Representation id="3" bandwidth="82814">
<BaseURL>dash_audio2.webm</BaseURL> <BaseURL>dash_audio2.webm</BaseURL>
<SegmentBase <SegmentBase
indexRange="335312-335425"> indexRange="335312-335425">

Loading…
Cancel
Save