mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
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:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user