rtp*: support decoding negative timestamps

This commit is contained in:
aler9
2021-03-09 08:36:39 +01:00
parent a66c1a8bdf
commit 7be302bd03
3 changed files with 31 additions and 4 deletions

View File

@@ -55,6 +55,25 @@ var cases = []struct {
),
},
},
{
"negative timestamp",
&NALUAndTimestamp{
Timestamp: -20 * time.Millisecond,
NALU: mergeBytes(
[]byte{0x05},
bytes.Repeat([]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 8),
),
},
[][]byte{
mergeBytes(
[]byte{
0x80, 0xe0, 0x44, 0xed, 0x88, 0x77, 0x5f, 0x4d,
0x9d, 0xbb, 0x78, 0x12, 0x05,
},
bytes.Repeat([]byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 8),
),
},
},
{
"fragmented",
&NALUAndTimestamp{