From 48c156b36d47cefe72501c772469800166bc886d Mon Sep 17 00:00:00 2001 From: q191201771 <191201771@qq.com> Date: Wed, 22 Feb 2023 23:45:15 +0800 Subject: [PATCH] fix test --- pkg/rtmp/metadata_test.go | 3 ++- pkg/sdp/parse_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/rtmp/metadata_test.go b/pkg/rtmp/metadata_test.go index 64f6f9c..ebfea2f 100644 --- a/pkg/rtmp/metadata_test.go +++ b/pkg/rtmp/metadata_test.go @@ -53,7 +53,8 @@ func TestMetadata(t *testing.T) { w, err := rtmp.MetadataEnsureWithSdf(b) assert.Equal(t, nil, err) exp2 := "02000d40736574446174614672616d6502000a6f6e4d6574614461746103000577696474680040900000000000000006686569676874004088000000000000000c617564696f636f6465636964004024000000000000000c766964656f636f646563696400401c000000000000000776657273696f6e0200096c616c302e33322e3000036c616c020006302e33322e30000009" - strings.Replace(exp2, "302e33322e3", ver, -1) + // 注意,替换版本为当前版本 + exp2 = strings.Replace(exp2, "302e33322e30", ver, -1) assert.Equal(t, exp2, hex.EncodeToString(w)) wo, err = rtmp.MetadataEnsureWithoutSdf(b) diff --git a/pkg/sdp/parse_test.go b/pkg/sdp/parse_test.go index a8b9f06..ff9c099 100644 --- a/pkg/sdp/parse_test.go +++ b/pkg/sdp/parse_test.go @@ -345,7 +345,8 @@ a=appversion:1.0` assert.Equal(t, nil, err) assert.Equal(t, 8000, ctx.AudioClockRate) assert.Equal(t, 90000, ctx.VideoClockRate) - assert.Equal(t, base.AvPacketPtUnknown, ctx.audioPayloadTypeBase) + //assert.Equal(t, base.AvPacketPtUnknown, ctx.audioPayloadTypeBase) + assert.Equal(t, base.AvPacketPtG711A, ctx.audioPayloadTypeBase) assert.Equal(t, base.AvPacketPtHevc, ctx.videoPayloadTypeBase) assert.Equal(t, 8, ctx.audioPayloadTypeOrigin) assert.Equal(t, 96, ctx.videoPayloadTypeOrigin)