chore: add config change log

This commit is contained in:
langhuihui
2025-01-03 17:03:01 +08:00
parent a6114700d7
commit c6bb61eba8
2 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -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))
}