streaming

Media streaming and broadcast systems in Go
Log | Files | Refs | README | LICENSE

commit f9d860476fbcf68d9cb28f489eafc3db682a040c
parent 9c432babde8714bfa10488cf39bbabb0e476d3b5
Author: Oliver Lowe <o@olowe.co>
Date:   Wed,  8 May 2024 17:03:13 +1000

internal/scte35: decode crc32 into SpliceInfo

Diffstat:
Minternal/scte35/splice_info.go | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/internal/scte35/splice_info.go b/internal/scte35/splice_info.go @@ -207,5 +207,13 @@ func decodeSpliceInfo(buf []byte) (*SpliceInfo, error) { return nil, fmt.Errorf("decode splice descriptors: %w", err) } info.Descriptors = descriptors + + buf = buf[2+desclen:] + if info.Encrypted { + // TODO(otl): handle alignment_stuffing for encrypted packets. + // skip past E_CRC_32; we don't store it. + buf = buf[1:] + } + info.CRC32 = binary.BigEndian.Uint32(buf) return &info, nil }