pull/263/head
q191201771 2 years ago
parent e2371e7c88
commit 48c156b36d

@ -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)

@ -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)

Loading…
Cancel
Save