From a2dde6442ddcffcf4486d6c62085cb28eded2793 Mon Sep 17 00:00:00 2001 From: penglh Date: Fri, 7 Apr 2023 10:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3CustomizePubSessionContext?= =?UTF-8?q?=E4=BD=BF=E7=94=A8dumpFile=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/logic/customize_pubsession.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/logic/customize_pubsession.go b/pkg/logic/customize_pubsession.go index 40f0059..9c96d93 100644 --- a/pkg/logic/customize_pubsession.go +++ b/pkg/logic/customize_pubsession.go @@ -84,7 +84,9 @@ func (ctx *CustomizePubSessionContext) FeedAudioSpecificConfig(asc []byte) error return base.ErrDisposedInStream } //nazalog.Debugf("[%s] FeedAudioSpecificConfig. asc=%s", ctx.uniqueKey, hex.Dump(asc)) - ctx.dumpFile.WriteWithType(asc, base.DumpTypeCustomizePubAudioSpecificConfigData) + if ctx.dumpFile != nil { + _ = ctx.dumpFile.WriteWithType(asc, base.DumpTypeCustomizePubAudioSpecificConfigData) + } ctx.remuxer.InitWithAvConfig(asc, nil, nil, nil) return nil } @@ -95,7 +97,9 @@ func (ctx *CustomizePubSessionContext) FeedAvPacket(packet base.AvPacket) error return base.ErrDisposedInStream } //nazalog.Debugf("[%s] FeedAvPacket. packet=%s", ctx.uniqueKey, packet.DebugString()) - ctx.dumpFile.WriteAvPacket(packet, base.DumpTypeCustomizePubData) + if ctx.dumpFile != nil { + _ = ctx.dumpFile.WriteAvPacket(packet, base.DumpTypeCustomizePubData) + } ctx.remuxer.FeedAvPacket(packet) return nil }