Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ff34f7

Browse filesBrowse files
authored
Add audio label to the adaptationset (#98)
* Add audio label in Adaptation set * Remove old label * Add label back for subtitles as element
1 parent 86dec6e commit 0ff34f7
Copy full SHA for 0ff34f7

File tree

Expand file treeCollapse file tree

7 files changed

+19
-12
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+19
-12
lines changed

‎mpd/fixtures/hbbtv_profile.mpd

Copy file name to clipboardExpand all lines: mpd/fixtures/hbbtv_profile.mpd
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
<Representation bandwidth="2295158" codecs="avc1.4d401f" frameRate="30000/1001" height="576" id="1200" width="1024"></Representation>
3434
<Representation bandwidth="2780732" codecs="avc1.4d401f" frameRate="30000/1001" height="720" id="1500" width="1280"></Representation>
3535
</AdaptationSet>
36-
<AdaptationSet mimeType="text/vtt" id="7357" lang="en" label="Subtitle (En)">
36+
<AdaptationSet mimeType="text/vtt" id="7357" lang="en">
3737
<Representation bandwidth="256" id="subtitle_en">
3838
<BaseURL>http://example.com/content/sintel/subtitles/subtitles_en.vtt</BaseURL>
3939
</Representation>
40+
<Label>Subtitle (En)</Label>
4041
</AdaptationSet>
4142
</Period>
4243
</MPD>

‎mpd/fixtures/live_profile.mpd

Copy file name to clipboardExpand all lines: mpd/fixtures/live_profile.mpd
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
<Representation bandwidth="2295158" codecs="avc1.4d401f" frameRate="30000/1001" height="576" id="1200" width="1024"></Representation>
3232
<Representation bandwidth="2780732" codecs="avc1.4d401f" frameRate="30000/1001" height="720" id="1500" width="1280"></Representation>
3333
</AdaptationSet>
34-
<AdaptationSet mimeType="text/vtt" id="7357" lang="en" label="Subtitle (En)">
34+
<AdaptationSet mimeType="text/vtt" id="7357" lang="en">
3535
<Representation bandwidth="256" id="subtitle_en">
3636
<BaseURL>http://example.com/content/sintel/subtitles/subtitles_en.vtt</BaseURL>
3737
</Representation>
38+
<Label>Subtitle (En)</Label>
3839
</AdaptationSet>
3940
</Period>
4041
</MPD>

‎mpd/fixtures/live_profile_dynamic.mpd

Copy file name to clipboardExpand all lines: mpd/fixtures/live_profile_dynamic.mpd
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
<Representation bandwidth="2295158" codecs="avc1.4d401f" frameRate="30000/1001" height="576" id="1200" width="1024"></Representation>
3232
<Representation bandwidth="2780732" codecs="avc1.4d401f" frameRate="30000/1001" height="720" id="1500" width="1280"></Representation>
3333
</AdaptationSet>
34-
<AdaptationSet mimeType="text/vtt" id="7357" lang="en" label="Subtitle (En)">
34+
<AdaptationSet mimeType="text/vtt" id="7357" lang="en">
3535
<Representation bandwidth="256" id="subtitle_en">
3636
<BaseURL>http://example.com/content/sintel/subtitles/subtitles_en.vtt</BaseURL>
3737
</Representation>
38+
<Label>Subtitle (En)</Label>
3839
</AdaptationSet>
3940
</Period>
4041
<UTCTiming></UTCTiming>

‎mpd/fixtures/live_profile_multi_base_url.mpd

Copy file name to clipboardExpand all lines: mpd/fixtures/live_profile_multi_base_url.mpd
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
<Representation bandwidth="2295158" codecs="avc1.4d401f" frameRate="30000/1001" height="576" id="1200" width="1024"></Representation>
3535
<Representation bandwidth="2780732" codecs="avc1.4d401f" frameRate="30000/1001" height="720" id="1500" width="1280"></Representation>
3636
</AdaptationSet>
37-
<AdaptationSet mimeType="text/vtt" id="7357" lang="en" label="Subtitle (En)">
37+
<AdaptationSet mimeType="text/vtt" id="7357" lang="en">
3838
<Representation bandwidth="256" id="subtitle_en">
3939
<BaseURL>http://example.com/content/sintel/subtitles/subtitles_en.vtt</BaseURL>
4040
</Representation>
41+
<Label>Subtitle (En)</Label>
4142
</AdaptationSet>
4243
</Period>
4344
</MPD>

‎mpd/fixtures/ondemand_profile.mpd

Copy file name to clipboardExpand all lines: mpd/fixtures/ondemand_profile.mpd
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@
4040
</SegmentBase>
4141
</Representation>
4242
</AdaptationSet>
43-
<AdaptationSet mimeType="text/vtt" id="7357" lang="en" label="Subtitle (En)">
43+
<AdaptationSet mimeType="text/vtt" id="7357" lang="en">
4444
<Representation bandwidth="256" id="subtitle_en">
4545
<BaseURL>http://example.com/content/sintel/subtitles/subtitles_en.vtt</BaseURL>
4646
</Representation>
47+
<Label>Subtitle (En)</Label>
4748
</AdaptationSet>
4849
</Period>
4950
</MPD>

‎mpd/mpd.go

Copy file name to clipboardExpand all lines: mpd/mpd.go
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ type AdaptationSet struct {
190190
SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` // Live Profile Only
191191
Representations []*Representation `xml:"Representation,omitempty"`
192192
AccessibilityElems []*Accessibility `xml:"Accessibility,omitempty"`
193-
Label *string `xml:"label,attr"`
193+
Labels []string `xml:"Label,omitempty"`
194194
BaseURL []string `xml:"BaseURL,omitempty"`
195195
}
196196

@@ -660,8 +660,8 @@ func (m *MPD) AddNewAdaptationSetSubtitleWithID(id string, mimeType string, lang
660660
// label - Label for the subtitle from Studio (i.e. American)
661661
func (period *Period) AddNewAdaptationSetSubtitle(mimeType string, lang string, label string) (*AdaptationSet, error) {
662662
as := &AdaptationSet{
663-
Lang: Strptr(lang),
664-
Label: Strptr(label),
663+
Lang: Strptr(lang),
664+
Labels: []string{label},
665665
CommonAttributesAndElements: CommonAttributesAndElements{
666666
MimeType: Strptr(mimeType),
667667
},
@@ -679,9 +679,9 @@ func (period *Period) AddNewAdaptationSetSubtitle(mimeType string, lang string,
679679
// label - Label for the subtitle from Studio (i.e. American)
680680
func (period *Period) AddNewAdaptationSetSubtitleWithID(id string, mimeType string, lang string, label string) (*AdaptationSet, error) {
681681
as := &AdaptationSet{
682-
ID: Strptr(id),
683-
Lang: Strptr(lang),
684-
Label: Strptr(label),
682+
ID: Strptr(id),
683+
Lang: Strptr(lang),
684+
Labels: []string{label},
685685
CommonAttributesAndElements: CommonAttributesAndElements{
686686
MimeType: Strptr(mimeType),
687687
},

‎mpd/mpd_read_write_test.go

Copy file name to clipboardExpand all lines: mpd/mpd_read_write_test.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ func TestAddNewAdaptationSetSubtitleWriteToString(t *testing.T) {
173173
expectedXML := `<?xml version="1.0" encoding="UTF-8"?>
174174
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediaPresentationDuration="PT6M16S" minBufferTime="PT1.97S">
175175
<Period>
176-
<AdaptationSet mimeType="text/vtt" id="7357" lang="en" label="Subtitle (En)"></AdaptationSet>
176+
<AdaptationSet mimeType="text/vtt" id="7357" lang="en">
177+
<Label>Subtitle (En)</Label>
178+
</AdaptationSet>
177179
</Period>
178180
</MPD>
179181
`

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.