Support AAC tracks with custom sizelength, indexlength and indexdeltalength (#118)

* aac decode by sdp sizelength and indexlength

* fix linting

* fix linting

* 64-95 lines are duplicate of `track_aac_test.go:130-161` (dupl)

* fix linting

* fix linting

* decode aac use IndexDeltaLength
This commit is contained in:
Shi Ben
2022-04-15 18:35:54 +08:00
committed by GitHub
parent d479e9ee7d
commit bed854ece6
8 changed files with 302 additions and 80 deletions

View File

@@ -37,10 +37,16 @@ func main() {
// find the AAC track
var clockRate int
var sizeLength int
var indexLength int
var indexDeltaLength int
aacTrack := func() int {
for i, track := range tracks {
if _, ok := track.(*gortsplib.TrackAAC); ok {
if tt, ok := track.(*gortsplib.TrackAAC); ok {
clockRate = track.ClockRate()
sizeLength = tt.SizeLength()
indexLength = tt.IndexLength()
indexDeltaLength = tt.IndexDeltaLength()
return i
}
}
@@ -52,7 +58,10 @@ func main() {
// setup decoder
dec := &rtpaac.Decoder{
SampleRate: clockRate,
SampleRate: clockRate,
SizeLength: sizeLength,
IndexLength: indexLength,
IndexDeltaLength: indexDeltaLength,
}
dec.Init()