@@ -118,11 +118,11 @@ type CommonAttributesAndElements struct {
118118 StartWithSAP * int64 `xml:"startWithSAP,attr"`
119119 MaxPlayoutRate * string `xml:"maxPlayoutRate,attr"`
120120 ScanType * string `xml:"scanType,attr"`
121- FramePacking * DescriptorType `xml:"framePacking,attr "`
122- AudioChannelConfiguration * DescriptorType `xml:"audioChannelConfiguration,attr "`
121+ FramePacking [] DescriptorType `xml:"FramePacking,omitempty "`
122+ AudioChannelConfiguration [] DescriptorType `xml:"AudioChannelConfiguration,omitempty "`
123123 ContentProtection []ContentProtectioner `xml:"ContentProtection,omitempty"`
124- EssentialProperty * DescriptorType `xml:"essentialProperty,attr "`
125- SupplementalProperty * DescriptorType `xml:"supplmentalProperty,attr "`
124+ EssentialProperty [] DescriptorType `xml:"EssentialProperty,omitempty "`
125+ SupplementalProperty [] DescriptorType `xml:"SupplementalProperty,omitempty "`
126126 InbandEventStream * DescriptorType `xml:"inbandEventStream,attr"`
127127}
128128
@@ -151,32 +151,30 @@ type AdaptationSet struct {
151151}
152152
153153func (as * AdaptationSet ) UnmarshalXML (d * xml.Decoder , start xml.StartElement ) error {
154-
155- adaptationSet := struct {
156- CommonAttributesAndElements
157- XMLName xml.Name `xml:"AdaptationSet"`
158- ID * string `xml:"id,attr"`
159- SegmentAlignment * bool `xml:"segmentAlignment,attr"`
160- Lang * string `xml:"lang,attr"`
161- Group * string `xml:"group,attr"`
162- PAR * string `xml:"par,attr"`
163- MinBandwidth * string `xml:"minBandwidth,attr"`
164- MaxBandwidth * string `xml:"maxBandwidth,attr"`
165- MinWidth * string `xml:"minWidth,attr"`
166- MaxWidth * string `xml:"maxWidth,attr"`
167- MinHeight * string `xml:"minHeight,attr"`
168- MaxHeight * string `xml:"maxHeight,attr"`
169- ContentType * string `xml:"contentType,attr"`
170- ContentProtection []ContentProtectioner `xml:"ContentProtection,omitempty"` // Common attribute, can be deprecated here
171- Roles []* Role `xml:"Role,omitempty"`
172- SegmentBase * SegmentBase `xml:"SegmentBase,omitempty"`
173- SegmentList * SegmentList `xml:"SegmentList,omitempty"`
174- SegmentTemplate * SegmentTemplate `xml:"SegmentTemplate,omitempty"` // Live Profile Only
175- Representations []* Representation `xml:"Representation,omitempty"`
176- AccessibilityElems []* Accessibility `xml:"Accessibility,omitempty"`
177- }{}
178-
179154 var (
155+ adaptationSet struct {
156+ CommonAttributesAndElements
157+ XMLName xml.Name `xml:"AdaptationSet"`
158+ ID * string `xml:"id,attr"`
159+ SegmentAlignment * bool `xml:"segmentAlignment,attr"`
160+ Lang * string `xml:"lang,attr"`
161+ Group * string `xml:"group,attr"`
162+ PAR * string `xml:"par,attr"`
163+ MinBandwidth * string `xml:"minBandwidth,attr"`
164+ MaxBandwidth * string `xml:"maxBandwidth,attr"`
165+ MinWidth * string `xml:"minWidth,attr"`
166+ MaxWidth * string `xml:"maxWidth,attr"`
167+ MinHeight * string `xml:"minHeight,attr"`
168+ MaxHeight * string `xml:"maxHeight,attr"`
169+ ContentType * string `xml:"contentType,attr"`
170+ ContentProtection []ContentProtectioner `xml:"ContentProtection,omitempty"` // Common attribute, can be deprecated here
171+ Roles []* Role `xml:"Role,omitempty"`
172+ SegmentBase * SegmentBase `xml:"SegmentBase,omitempty"`
173+ SegmentList * SegmentList `xml:"SegmentList,omitempty"`
174+ SegmentTemplate * SegmentTemplate `xml:"SegmentTemplate,omitempty"` // Live Profile Only
175+ Representations []* Representation `xml:"Representation,omitempty"`
176+ AccessibilityElems []* Accessibility `xml:"Accessibility,omitempty"`
177+ }
180178 contentProtectionTags []ContentProtectioner
181179 roles []* Role
182180 segmentBase * SegmentBase
@@ -258,11 +256,23 @@ func (as *AdaptationSet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) er
258256 }
259257 representations = append (representations , rp )
260258 case "Accessibility" :
261- ac := new (Accessibility )
262- err = d .DecodeElement (ac , & tt )
263- if err != nil {
259+ var a Accessibility
260+ adaptationSet .AccessibilityElems = append (adaptationSet .AccessibilityElems , & a )
261+ if err = d .DecodeElement (& a , & tt ); err != nil {
262+ return err
263+ }
264+ case "AudioChannelConfiguration" :
265+ var dt DescriptorType
266+ if err = d .DecodeElement (& dt , & tt ); err != nil {
267+ return err
268+ }
269+ adaptationSet .AudioChannelConfiguration = append (adaptationSet .AudioChannelConfiguration , dt )
270+ case "SupplementalProperty" :
271+ var dt DescriptorType
272+ if err = d .DecodeElement (& dt , & tt ); err != nil {
264273 return err
265274 }
275+ adaptationSet .SupplementalProperty = append (adaptationSet .SupplementalProperty , dt )
266276 default :
267277 return fmt .Errorf ("unrecognized element in AdaptationSet %q" , tt .Name .Local )
268278 }
0 commit comments