diff --git a/mpd/mpd.go b/mpd/mpd.go index 022cb45..a19850e 100644 --- a/mpd/mpd.go +++ b/mpd/mpd.go @@ -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() { @@ -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"` @@ -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 @@ -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),