diff --git a/subscriber.go b/subscriber.go index 43fb653..0d03af2 100644 --- a/subscriber.go +++ b/subscriber.go @@ -228,7 +228,7 @@ func (s *Subscriber) PlayBlock(spesic ISubscriber) { if s.VideoTrack.IDRing.Value.Sequence != firstIFrame.Sequence { firstIFrame = nil s.vr = s.VideoTrack.ReadRing() - s.Debug("skip to latest key frame") + s.Debug("skip to latest key frame", zap.Uint32("seq", s.VideoTrack.IDRing.Value.Sequence)) continue } else { vp = (*VideoFrame)(s.vr.Read(ctx)) diff --git a/util/buffer.go b/util/buffer.go index 26dbf15..3aa02cd 100644 --- a/util/buffer.go +++ b/util/buffer.go @@ -97,6 +97,7 @@ func SizeOfBuffers[T ~[]byte](buf []T) (size int) { // SplitBuffers 按照一定大小分割 Buffers func SplitBuffers[T ~[]byte](buf []T, size int) (result [][]T) { + buf = append([]T(nil), buf...) for total := SizeOfBuffers(buf); total > 0; { if total <= size { return append(result, buf)