protocol/rtcp: renamed highestSequence() to sequence.

This commit is contained in:
Saxon 2019-04-23 14:16:40 +09:30
parent 6b994d0dba
commit b43f6f8072
1 changed files with 6 additions and 6 deletions

View File

@ -61,7 +61,7 @@ type Client struct {
name string // Name of the client for source description purposes. name string // Name of the client for source description purposes.
sourceSSRC uint32 // Source identifier of this client. sourceSSRC uint32 // Source identifier of this client.
mu sync.Mutex // Will be used to change parameters during operation safely. mu sync.Mutex // Will be used to change parameters during operation safely.
sequence uint32 // Last RTP sequence number. seq uint32 // Last RTP sequence number.
senderTs [8]byte // The timestamp of the last sender report. senderTs [8]byte // The timestamp of the last sender report.
interval time.Duration // Interval between sender report and receiver report. interval time.Duration // Interval between sender report and receiver report.
receiveTime time.Time // Time last sender report was received. receiveTime time.Time // Time last sender report was received.
@ -177,7 +177,7 @@ func (c *Client) send() {
SSRC: c.sourceSSRC, SSRC: c.sourceSSRC,
FractionLost: 0, FractionLost: 0,
PacketsLost: math.MaxUint32, PacketsLost: math.MaxUint32,
HighestSequence: c.highestSequence(), HighestSequence: c.sequence(),
Jitter: c.jitter(), Jitter: c.jitter(),
LSR: c.lastSenderTs(), LSR: c.lastSenderTs(),
DLSR: c.delay(), DLSR: c.delay(),
@ -242,14 +242,14 @@ func (c *Client) parse(buf []byte) {
// through an RTP stream. // through an RTP stream.
func (c *Client) SetSequence(s uint32) { func (c *Client) SetSequence(s uint32) {
c.mu.Lock() c.mu.Lock()
c.sequence = s c.seq = s
c.mu.Unlock() c.mu.Unlock()
} }
// highestSequence will return the highest sequence number received through RTP. // sequence will return the highest sequence number received through RTP.
func (c *Client) highestSequence() uint32 { func (c *Client) sequence() uint32 {
c.mu.Lock() c.mu.Lock()
s := c.sequence s := c.seq
c.mu.Unlock() c.mu.Unlock()
return s return s
} }