diff --git a/pkg/aac/aac_test.go b/pkg/aac/aac_test.go index 61f4a51..1ad54c8 100644 --- a/pkg/aac/aac_test.go +++ b/pkg/aac/aac_test.go @@ -85,6 +85,13 @@ func TestAscContext(t *testing.T) { sf, err = ascCtx.GetSamplingFrequency() assert.Equal(t, -1, sf) assert.IsNotNil(t, err) + + // case + ascCtx, err = aac.NewAscContext([]byte{0x14, 0x08}) + assert.Equal(t, nil, err) + sf, err = ascCtx.GetSamplingFrequency() + assert.Equal(t, 16000, sf) + assert.Equal(t, nil, err) } func TestMakeAudioDataSeqHeader(t *testing.T) { diff --git a/pkg/rtprtcp/rtprtcp_test.go b/pkg/rtprtcp/rtprtcp_test.go index bbb1c3c..88cb532 100644 --- a/pkg/rtprtcp/rtprtcp_test.go +++ b/pkg/rtprtcp/rtprtcp_test.go @@ -9,9 +9,8 @@ package rtprtcp_test import ( - "testing" - "github.com/q191201771/lal/pkg/innertest" + "testing" ) func TestRtpRtcp(t *testing.T) { diff --git a/pkg/sdp/parse_test.go b/pkg/sdp/parse_test.go index a6497b0..68813a9 100644 --- a/pkg/sdp/parse_test.go +++ b/pkg/sdp/parse_test.go @@ -626,3 +626,37 @@ func TestCase15(t *testing.T) { //a=rtpmap:8 PCMA/8000 //a=recvonly } + +func TestCase16(t *testing.T) { + golden := `v=0 +o=- 1667405799319376 1667405799319376 IN IP4 192.168.1.64 +s=Media Presentation +e=NONE +b=AS:5100 +t=0 0 +a=control:rtsp://192.168.1.64/ +m=video 0 RTP/AVP 96 +c=IN IP4 0.0.0.0 +b=AS:5000 +a=recvonly +a=x-dimensions:1920,1080 +a=control:rtsp://192.168.1.64/trackID=1 +a=rtpmap:96 H264/90000 +a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z00AKY2NQDwBE/LNwEBAUAAAcIAAFfkAQA==,aO48gA== +m=audio 0 RTP/AVP 104 +c=IN IP4 0.0.0.0 +b=AS:50 +a=recvonly +a=control:rtsp://192.168.1.64/trackID=2 +a=rtpmap:104 mpeg4-generic/16000/1 +a=fmtp:104 profile-level-id=15; streamtype=5; mode=AAC-hbr; config=1408;SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1; +a=Media_header:MEDIAINFO=494D4B48010300000400000101200110803E0000007D000000000000000000000000000000000000; +a=appversion:1.0 +` + golden = strings.ReplaceAll(golden, "\n", "\r\n") + ctx, err := ParseSdp2LogicContext([]byte(golden)) + var avcCtx avc.Context + avc.ParseSps(ctx.Sps, &avcCtx) + assert.Equal(t, nil, err) + _ = ctx +}