From 92be04112b40af4c99f78c26d7054583e38ebcee Mon Sep 17 00:00:00 2001 From: Khoi Van Nguyen Date: Mon, 23 Dec 2024 14:53:42 +0700 Subject: [PATCH] add ac-3/ec-3 support --- cmd/cmaf-ingest-receiver/app/channel.go | 2 +- cmd/livesim2/app/asset.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/cmaf-ingest-receiver/app/channel.go b/cmd/cmaf-ingest-receiver/app/channel.go index 40c2ef8..e6748ca 100644 --- a/cmd/cmaf-ingest-receiver/app/channel.go +++ b/cmd/cmaf-ingest-receiver/app/channel.go @@ -180,7 +180,7 @@ func (ch *channel) addInitDataAndUpdateTimescale(stream stream, init *mp4.InitSe ch.addTrData(r) switch sampleEntry { - case "avc1", "hvc1", "mp4a", "stpp", "wvtt": + case "avc1", "hvc1", "mp4a", "ac-3", "ec-3", "stpp", "wvtt": // OK case "evte": // Event stream. Don't add to MPD or contentinfo, but keep the segments. // TODO. Handle event streams for SCTE-35 events and other cases diff --git a/cmd/livesim2/app/asset.go b/cmd/livesim2/app/asset.go index ebde6f4..01abe8f 100644 --- a/cmd/livesim2/app/asset.go +++ b/cmd/livesim2/app/asset.go @@ -706,6 +706,9 @@ func (r RepData) sampleDur() uint32 { switch { case strings.HasPrefix(r.Codecs, "mp4a.40") && r.MediaTimescale == 48000: return 1024 + // TODO support other timescale such as 32kHz and 44.1kHz + case (strings.HasPrefix(r.Codecs, "ac-3") || strings.HasPrefix(r.Codecs, "ec-3")) && r.MediaTimescale == 48000: + return 1536 default: return 0 }