From c6bb61eba828a690a55b378ef746d65da12bb17c Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Fri, 3 Jan 2025 17:03:01 +0800 Subject: [PATCH] chore: add config change log --- publisher.go | 4 ++++ subscriber.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/publisher.go b/publisher.go index a3c779b..619b75f 100644 --- a/publisher.go +++ b/publisher.go @@ -403,9 +403,13 @@ func (p *Publisher) WriteVideo(data IAVFrame) (err error) { p.Error("parse", "err", err) return err } + if t.ICodecCtx == nil { return ErrUnsupportCodec } + if codecCtxChanged { + p.Info("video codec changed", "width", t.ICodecCtx.(IVideoCodecCtx).Width(), "height", t.ICodecCtx.(IVideoCodecCtx).Height()) + } var idr *util.Ring[AVFrame] if t.IDRingList.Len() > 0 { idr = t.IDRingList.Back().Value diff --git a/subscriber.go b/subscriber.go index a04651d..55e89a6 100644 --- a/subscriber.go +++ b/subscriber.go @@ -434,7 +434,6 @@ func (handler *SubscribeHandler[A, V]) Run() (err error) { if handler.videoFrame.IDR && vr.DecConfChanged() { vr.LastCodecCtx = vr.Track.ICodecCtx if seqFrame := vr.Track.SequenceFrame; seqFrame != nil { - s.Debug("video codec changed", "data", seqFrame.String()) if handler.vwi >= 0 { err = handler.OnVideo(seqFrame.(V)) }