mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-26 19:51:14 +08:00
fix: use engine's aac format
This commit is contained in:
@@ -72,6 +72,7 @@ func (p *RTSPPublisher) SetTracks() error {
|
||||
conf = f.StreamMuxConfig.Programs[0].Layers[0].AudioSpecificConfig
|
||||
}
|
||||
at := p.CreateAudioTrack(codec.CodecID_AAC, byte(f.PayloadType()), uint32(conf.SampleRate)).(*AAC)
|
||||
at.AACFormat = f
|
||||
at.AACDecoder.LATM = f.LATM
|
||||
at.AACDecoder.IndexDeltaLength = f.IndexDeltaLength
|
||||
at.AACDecoder.IndexLength = f.IndexLength
|
||||
|
@@ -69,9 +69,9 @@ func (s *RTSPSubscriber) OnEvent(event any) {
|
||||
}
|
||||
switch v.CodecID {
|
||||
case codec.CodecID_AAC:
|
||||
s.audioTrack = &description.Media{
|
||||
Type: description.MediaTypeAudio,
|
||||
Formats: []format.Format{&format.MPEG4Audio{
|
||||
f := v.AACFormat
|
||||
if f == nil {
|
||||
f = &format.MPEG4Audio{
|
||||
PayloadTyp: v.PayloadType,
|
||||
Config: &mpeg4audio.Config{
|
||||
Type: mpeg4audio.ObjectTypeAACLC,
|
||||
@@ -81,7 +81,11 @@ func (s *RTSPSubscriber) OnEvent(event any) {
|
||||
SizeLength: v.AACDecoder.SizeLength,
|
||||
IndexLength: v.AACDecoder.IndexLength,
|
||||
IndexDeltaLength: v.AACDecoder.IndexDeltaLength,
|
||||
}},
|
||||
}
|
||||
}
|
||||
s.audioTrack = &description.Media{
|
||||
Type: description.MediaTypeAudio,
|
||||
Formats: []format.Format{f},
|
||||
}
|
||||
case codec.CodecID_PCMA:
|
||||
s.audioTrack = &description.Media{
|
||||
|
Reference in New Issue
Block a user