Skip to content

Commit 17873b0

Browse files
peer(minor): rename variables for clarity
1 parent cf9880b commit 17873b0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/peer/peer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,24 +134,24 @@ func (p *Peer[ID]) SubscribeTo(track *webrtc.TrackLocalStaticRTP) error {
134134
func (p *Peer[ID]) WriteRTCP(trackID string, packets []RTCPPacketType) error {
135135
// Find the right track.
136136
receivers := p.peerConnection.GetReceivers()
137-
trackIndex := slices.IndexFunc(receivers, func(receiver *webrtc.RTPReceiver) bool {
137+
receiverIndex := slices.IndexFunc(receivers, func(receiver *webrtc.RTPReceiver) bool {
138138
return receiver.Track().ID() == trackID
139139
})
140-
if trackIndex == -1 {
140+
if receiverIndex == -1 {
141141
return ErrTrackNotFound
142142
}
143143

144-
// The SSRC that we must use when sending the RTCP packet.
144+
// The ssrc that we must use when sending the RTCP packet.
145145
// Otherwise the peer won't understand where the packet comes from.
146-
SSRC := uint32(receivers[trackIndex].Track().SSRC())
146+
ssrc := uint32(receivers[receiverIndex].Track().SSRC())
147147

148148
toSend := make([]rtcp.Packet, len(packets))
149149
for i, packet := range packets {
150150
switch packet {
151151
case PictureLossIndicator:
152-
toSend[i] = &rtcp.PictureLossIndication{MediaSSRC: SSRC}
152+
toSend[i] = &rtcp.PictureLossIndication{MediaSSRC: ssrc}
153153
case FullIntraRequest:
154-
toSend[i] = &rtcp.FullIntraRequest{MediaSSRC: SSRC}
154+
toSend[i] = &rtcp.FullIntraRequest{MediaSSRC: ssrc}
155155
}
156156
}
157157

0 commit comments

Comments
 (0)