mirror of
https://github.com/aler9/gortsplib
synced 2025-10-29 09:42:30 +08:00
restore compatibility with go 1.17
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
//go:build go1.18
|
||||
// +build go1.18
|
||||
|
||||
package rtplpcm
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -9,61 +11,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var cases = []struct {
|
||||
name string
|
||||
samples []byte
|
||||
pts time.Duration
|
||||
pkts []*rtp.Packet
|
||||
}{
|
||||
{
|
||||
"single",
|
||||
[]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
|
||||
25 * time.Millisecond,
|
||||
[]*rtp.Packet{
|
||||
{
|
||||
Header: rtp.Header{
|
||||
Version: 2,
|
||||
Marker: false,
|
||||
PayloadType: 96,
|
||||
SequenceNumber: 17645,
|
||||
Timestamp: 2289527557,
|
||||
SSRC: 0x9dbb7812,
|
||||
},
|
||||
Payload: []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"splitted",
|
||||
bytes.Repeat([]byte{0x41, 0x42, 0x43}, 680),
|
||||
25 * time.Millisecond,
|
||||
[]*rtp.Packet{
|
||||
{
|
||||
Header: rtp.Header{
|
||||
Version: 2,
|
||||
Marker: false,
|
||||
PayloadType: 96,
|
||||
SequenceNumber: 17645,
|
||||
Timestamp: 2289527557,
|
||||
SSRC: 0x9dbb7812,
|
||||
},
|
||||
Payload: bytes.Repeat([]byte{0x41, 0x42, 0x43}, 486),
|
||||
},
|
||||
{
|
||||
Header: rtp.Header{
|
||||
Version: 2,
|
||||
Marker: false,
|
||||
PayloadType: 96,
|
||||
SequenceNumber: 17646,
|
||||
Timestamp: 2289527800,
|
||||
SSRC: 0x9dbb7812,
|
||||
},
|
||||
Payload: bytes.Repeat([]byte{0x41, 0x42, 0x43}, 194),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestDecode(t *testing.T) {
|
||||
for _, ca := range cases {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user