Skip to content

Commit 5974195

Browse files
committed
h265: log packet size if remuxing is needed
1 parent 73e0b63 commit 5974195

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

internal/formatprocessor/h265.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,12 @@ func (t *h265) ProcessRTPPacket( //nolint:dupl
299299
pkt.PaddingSize = 0
300300

301301
// RTP packets exceed maximum size: start re-encoding them
302-
if len(pkt.Payload) > t.RTPMaxPayloadSize {
303-
t.Parent.Log(logger.Info, "RTP packets are too big, remuxing them into smaller ones")
302+
if size := len(pkt.Payload); size > t.RTPMaxPayloadSize {
303+
t.Parent.Log(logger.Info,
304+
"RTP packets are too big (%d > %d), remuxing them into smaller ones",
305+
size,
306+
t.RTPMaxPayloadSize,
307+
)
304308

305309
v1 := pkt.SSRC
306310
v2 := pkt.SequenceNumber

internal/formatprocessor/h265_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestH265OversizedPackets(t *testing.T) {
100100

101101
p, err := New(1460, forma, false,
102102
Logger(func(_ logger.Level, s string, i ...interface{}) {
103-
require.Equal(t, "RTP packets are too big, remuxing them into smaller ones", fmt.Sprintf(s, i...))
103+
require.Equal(t, "RTP packets are too big (2000 > 1460), remuxing them into smaller ones", fmt.Sprintf(s, i...))
104104
logged = true
105105
}))
106106
require.NoError(t, err)

0 commit comments

Comments
 (0)