Fix panic on AVCCToCodec #1652

This commit is contained in:
Alex X
2025-05-22 15:52:10 +03:00
parent 7107508286
commit ae8145f266
2 changed files with 16 additions and 5 deletions
+7
View File
@@ -101,3 +101,10 @@ func TestDecodeSPS2(t *testing.T) {
require.Equal(t, uint16(640), sps.Width())
require.Equal(t, uint16(360), sps.Height())
}
func TestAVCCToCodec(t *testing.T) {
s := "000000196764001fac2484014016ec0440000003004000000c23c60c920000000568ee32c8b0000000d365"
b, _ := hex.DecodeString(s)
codec := AVCCToCodec(b)
require.Equal(t, "packetization-mode=1;profile-level-id=64001f;sprop-parameter-sets=Z2QAH6wkhAFAFuwEQAAAAwBAAAAMI8YMkg==,aO4yyLA=", codec.FmtpLine)
}