mirror of
https://github.com/livekit/livekit.git
synced 2026-05-03 11:56:23 +00:00
add comments
This commit is contained in:
@@ -297,6 +297,9 @@ var userTimestampMagic = [4]byte{'L', 'K', 'T', 'S'}
|
||||
|
||||
const userTimestampTrailerSize = 12
|
||||
|
||||
// stripUserTimestampTrailer returns the number of bytes to strip from the end of
|
||||
// an RTP payload if it contains a user-timestamp trailer (magic suffix "LKTS").
|
||||
// Trailers only appear on marker packets; returns 0 if absent or ineligible.
|
||||
func stripUserTimestampTrailer(payload []byte, marker bool) int {
|
||||
if !marker || len(payload) < userTimestampTrailerSize {
|
||||
return 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2023 LiveKit, Inc.
|
||||
// Copyright 2026 LiveKit, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -31,9 +31,9 @@ func makePayloadWithTrailer(videoLen int, timestampUs int64) []byte {
|
||||
|
||||
func TestStripUserTimestampTrailer(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
payload []byte
|
||||
marker bool
|
||||
name string
|
||||
payload []byte
|
||||
marker bool
|
||||
wantStrip int
|
||||
}{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user