From 344ab6f463b3230e80f69dc51cfa362af6ecb778 Mon Sep 17 00:00:00 2001 From: dexter <178529795@qq.com> Date: Mon, 20 Feb 2023 00:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4clockrate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publisher.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/publisher.go b/publisher.go index d4bfe57..3a08719 100644 --- a/publisher.go +++ b/publisher.go @@ -49,13 +49,12 @@ func (p *RTSPPublisher) SetTracks() error { vt.WriteSliceBytes(f.PPS) } case *format.MPEG4Audio: - at := NewAAC(p.Stream, f.PayloadType(), uint32(f.ClockRate())) + at := NewAAC(p.Stream, f.PayloadType(), uint32(f.Config.SampleRate)) p.Tracks[track] = at at.SizeLength = f.SizeLength if f.Config.Type == mpeg4audio.ObjectTypeAACLC { at.Mode = 1 } - at.SampleRate = uint32(f.Config.SampleRate) at.Channels = uint8(f.Config.ChannelCount) asc, _ := f.Config.Marshal() // 复用AVCC写入逻辑,解析出AAC的配置信息