From d12d9ff421027b7973fa0540905a5f06a271a730 Mon Sep 17 00:00:00 2001 From: banshan Date: Tue, 31 Dec 2024 13:52:26 +0800 Subject: [PATCH] fix: crypto no idr frame --- plugin/crypto/pkg/transform.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/crypto/pkg/transform.go b/plugin/crypto/pkg/transform.go index 71e0d06..46d9336 100644 --- a/plugin/crypto/pkg/transform.go +++ b/plugin/crypto/pkg/transform.go @@ -157,8 +157,9 @@ func (t *Transform) Go() error { } } if needEncrypt { - if encBytes, err := t.cryptor.Encrypt(mem); err == nil { - copyVideo.Nalus.Append(encBytes) + encBytes, err := t.cryptor.Encrypt(mem[2:]) + if err == nil { + copyVideo.Nalus.Append(append([]byte{mem[0], mem[1]}, encBytes...)) } else { copyVideo.Nalus.Append(mem) }