From 9f2ad562fcabb616f08dce63e86990258a4e8c11 Mon Sep 17 00:00:00 2001 From: "Diallo.H" Date: Wed, 10 Jan 2024 10:46:11 +0900 Subject: [PATCH] fix test code --- pkg/codecs/h264/sps_test.go | 9 ++++++--- pkg/formats/fmp4/init_test.go | 11 ++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/codecs/h264/sps_test.go b/pkg/codecs/h264/sps_test.go index a10a994..74aabc3 100644 --- a/pkg/codecs/h264/sps_test.go +++ b/pkg/codecs/h264/sps_test.go @@ -96,6 +96,7 @@ func TestSPSUnmarshal(t *testing.T) { }, SPS{ ProfileIdc: 66, + ChromaFormatIdc: 1, ConstraintSet0Flag: true, ConstraintSet1Flag: true, LevelIdc: 40, @@ -122,7 +123,7 @@ func TestSPSUnmarshal(t *testing.T) { }, }, 1920, - 1084, + 1080, 30, }, { @@ -368,6 +369,7 @@ func TestSPSUnmarshal(t *testing.T) { }, SPS{ ProfileIdc: 77, + ChromaFormatIdc: 1, LevelIdc: 41, Log2MaxFrameNumMinus4: 5, Log2MaxPicOrderCntLsbMinus4: 5, @@ -420,7 +422,7 @@ func TestSPSUnmarshal(t *testing.T) { }, }, 1920, - 1084, + 1080, 25, }, { @@ -434,6 +436,7 @@ func TestSPSUnmarshal(t *testing.T) { }, SPS{ ProfileIdc: 77, + ChromaFormatIdc: 1, ConstraintSet1Flag: true, LevelIdc: 40, Log2MaxFrameNumMinus4: 1, @@ -475,7 +478,7 @@ func TestSPSUnmarshal(t *testing.T) { }, }, 1920, - 1084, + 1080, 25, }, } { diff --git a/pkg/formats/fmp4/init_test.go b/pkg/formats/fmp4/init_test.go index 22ba321..c7b0d1e 100644 --- a/pkg/formats/fmp4/init_test.go +++ b/pkg/formats/fmp4/init_test.go @@ -5,8 +5,9 @@ import ( "testing" "github.com/aler9/writerseeker" - "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/stretchr/testify/require" + + "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" ) var testSPS = []byte{ @@ -391,7 +392,7 @@ var casesInit = []struct { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x07, 0x80, 0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, + 0x07, 0x80, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 'm', 'd', 'i', 'a', 0x00, 0x00, 0x00, 0x20, @@ -426,7 +427,7 @@ var casesInit = []struct { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x04, - 0x3c, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, + 0x38, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1321,7 +1322,7 @@ var casesInit = []struct { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x07, 0x80, 0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, + 0x07, 0x80, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 'm', 'd', 'i', 'a', 0x00, 0x00, 0x00, 0x20, @@ -1354,7 +1355,7 @@ var casesInit = []struct { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x04, - 0x3c, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, + 0x38, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,