File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -235,18 +235,34 @@ export class VisualSampleEntry extends SampleEntry {
235235}
236236
237237export class AudioSampleEntry extends SampleEntry {
238+ version : number ;
238239 channel_count : number ;
239240 samplesize : number ;
240241 samplerate : number ;
241242
243+ // Quicktime only
244+ extensions : Uint8Array ;
245+
242246 parse ( stream : MultiBufferStream ) {
243247 this . parseHeader ( stream ) ;
244- stream . readUint32Array ( 2 ) ;
248+ this . version = stream . readUint16 ( ) ;
249+ stream . readUint16 ( ) ; // revision
250+ stream . readUint32 ( ) ; // vendor
245251 this . channel_count = stream . readUint16 ( ) ;
246252 this . samplesize = stream . readUint16 ( ) ;
247253 stream . readUint16 ( ) ;
248254 stream . readUint16 ( ) ;
249255 this . samplerate = stream . readUint32 ( ) / ( 1 << 16 ) ;
256+
257+ const isQT = stream . isofile ?. ftyp ?. major_brand . includes ( 'qt' ) ;
258+ if ( isQT ) {
259+ if ( this . version === 1 ) {
260+ this . extensions = stream . readUint8Array ( 16 ) ;
261+ } else if ( this . version === 2 ) {
262+ this . extensions = stream . readUint8Array ( 36 ) ;
263+ }
264+ }
265+
250266 this . parseFooter ( stream ) ;
251267 }
252268
You can’t perform that action at this time.
0 commit comments