Skip to content

Commit

Permalink
add ac-3/ec-3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nvkhoi112358 committed Dec 30, 2024
1 parent 14e9f6d commit 0c4bb67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/cmaf-ingest-receiver/app/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion cmd/livesim2/app/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func (a *asset) generateTimelineEntriesFromRef(refSE segEntries, repID string) s
t = nextT
}
}
return se
return se, nil

Check failure on line 571 in cmd/livesim2/app/asset.go

View workflow job for this annotation

GitHub Actions / build (macos-latest, 1.22)

too many return values

Check failure on line 571 in cmd/livesim2/app/asset.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 1.22)

too many return values
}

func (a *asset) setReferenceRep() error {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 0c4bb67

Please sign in to comment.