Skip to content

Commit 7a48ecf

Browse files
authored
fix(audio_descriptor): incorrect length for audio_count during encode (#111)
* fix(audio_descriptor): incorrect length for audio_count during encode * chore: update version
1 parent b4db33c commit 7a48ecf

File tree

4 files changed

+754
-693
lines changed

4 files changed

+754
-693
lines changed

Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: "3"
33

44
vars:
5-
VERSION: "v1.7.0"
5+
VERSION: "v1.7.1"
66

77
tasks:
88
clean:

pkg/scte35/audio_descriptor.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (sd *AudioDescriptor) encode() ([]byte, error) {
8181
iow.PutUint32(8, AudioDescriptorTag)
8282
iow.PutUint32(8, uint32(length))
8383
iow.PutUint32(32, CUEIdentifier)
84-
iow.PutUint32(8, uint32(len(sd.AudioChannels)))
84+
iow.PutUint32(4, uint32(len(sd.AudioChannels)))
8585
iow.PutUint32(4, Reserved)
8686
for _, ad := range sd.AudioChannels {
8787
iow.PutUint32(8, ad.ComponentTag)
@@ -90,7 +90,9 @@ func (sd *AudioDescriptor) encode() ([]byte, error) {
9090
iow.PutUint32(4, ad.NumChannels)
9191
iow.PutBit(ad.FullSrvcAudio)
9292
}
93-
return buf, nil
93+
94+
err := iow.Flush()
95+
return buf, err
9496
}
9597

9698
// descriptorLength returns the descriptor_length

0 commit comments

Comments
 (0)