Skip to content

audio_descriptor: encoder writes 12 bits, decoder expects 8 bits #110

@tomstolarczuk

Description

@tomstolarczuk

In pkg/scte35/audio_descriptor.go, there’s a mismatch between how the encoder and decoder handle the audio_count and reserved fields.

During decode:

audioCount := int(r.Uint32(4))
r.Skip(4) // reserved

That reads 4 bits for audio_count and 4 bits for reserved (8 bits total).

During encode:

iow.PutUint32(8, uint32(len(sd.AudioChannels)))
iow.PutUint32(4, Reserved)

That writes 8 bits for audio_count and 4 bits for reserved (12 bits total).

That causes decode errors like:

audio_descriptor: buffer underflow

According to the SCTE-35 spec, audio_count is a 4-bit field, not 8.

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions