Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions mpd/mpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,14 @@ func (as *AdaptationSet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) er
return err
}
representations = append(representations, rp)
case "Accessibility":
ac := new(Accessibility)
err = d.DecodeElement(ac, &tt)
if err != nil {
return err
}
default:
return errors.New("Unrecognized element in AdaptationSet")
return errors.New("Unrecognized element in AdaptationSet: " + tt.Name.Local)
}
case xml.EndElement:
if tt == start.End() {
Expand Down Expand Up @@ -411,7 +417,7 @@ type SegmentTemplate struct {
AdaptationSet *AdaptationSet `xml:"-"`
SegmentTimeline *SegmentTimeline `xml:"SegmentTimeline,omitempty"`
PresentationTimeOffset *uint64 `xml:"presentationTimeOffset,attr,omitempty"`
Duration *int64 `xml:"duration,attr"`
Duration *float64 `xml:"duration,attr"`
Initialization *string `xml:"initialization,attr"`
Media *string `xml:"media,attr"`
StartNumber *int64 `xml:"startNumber,attr"`
Expand All @@ -435,6 +441,11 @@ type Representation struct {
SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"`
}

type Accessibility struct {
SchemeIdUri *string `xml:"schemeIdUri,omitempty"`
Value *int64 `xml:"value,omitempty"`
}

type AudioChannelConfiguration struct {
SchemeIDURI *string `xml:"schemeIdUri,attr"`
// Value will be an int for non-Dolby Schemes, and a hexstring for Dolby Schemes, hence we make it a string
Expand Down Expand Up @@ -923,9 +934,9 @@ func (as *AdaptationSet) AddContentProtection(cp ContentProtectioner) error {
// media - template string for media segments.
// startNumber - the number to start segments from ($Number$) (i.e. 0).
// timescale - sets the timescale for duration (i.e. 1000, represents milliseconds).
func (as *AdaptationSet) SetNewSegmentTemplate(duration int64, init string, media string, startNumber int64, timescale int64) (*SegmentTemplate, error) {
func (as *AdaptationSet) SetNewSegmentTemplate(duration float64, init string, media string, startNumber int64, timescale int64) (*SegmentTemplate, error) {
st := &SegmentTemplate{
Duration: Int64ptr(duration),
Duration: Float64ptr(duration),
Initialization: Strptr(init),
Media: Strptr(media),
StartNumber: Int64ptr(startNumber),
Expand Down