From 4d770cef942242bcf8b6f1642c12f86c164aea3a Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:05:46 +0100 Subject: [PATCH] hide normal decoder states from logs --- internal/core/streamtrack_h264.go | 3 +++ internal/core/streamtrack_mpeg4audio.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/internal/core/streamtrack_h264.go b/internal/core/streamtrack_h264.go index 14d0bd49..eae56895 100644 --- a/internal/core/streamtrack_h264.go +++ b/internal/core/streamtrack_h264.go @@ -214,6 +214,9 @@ func (t *streamTrackH264) onData(dat data, hasNonRTSPReaders bool) error { nalus, pts, err := t.decoder.Decode(pkt) if err != nil { + if err == rtph264.ErrNonStartingPacketAndNoPrevious || err == rtph264.ErrMorePacketsNeeded { + return nil + } return err } diff --git a/internal/core/streamtrack_mpeg4audio.go b/internal/core/streamtrack_mpeg4audio.go index 774d96cb..5edcdb23 100644 --- a/internal/core/streamtrack_mpeg4audio.go +++ b/internal/core/streamtrack_mpeg4audio.go @@ -74,6 +74,9 @@ func (t *streamTrackMPEG4Audio) onData(dat data, hasNonRTSPReaders bool) error { aus, pts, err := t.decoder.Decode(pkt) if err != nil { + if err == rtpmpeg4audio.ErrMorePacketsNeeded { + return nil + } return err }