Skip to content

Commit 9ab7d95

Browse files
committed
Copilot review
1 parent 5a23b30 commit 9ab7d95

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

pkg/flexfec/flexfec_coverage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func extractMask1(mask util.BitArray) uint16 {
150150
func extractMask2(mask util.BitArray) uint32 {
151151
// We remove the first 15 bits
152152
mask2 := mask.Lo << 15
153-
// We get the first 31 bits (64 - 31 -> shift by 33) and we shift once more for K field
153+
// We get the first 31 bits (64 - 32 -> shift by 32) and we shift once more for K field
154154
mask2 >>= 33
155155

156156
return uint32(mask2) //nolint:gosec

pkg/flexfec/flexfec_encoder_03.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func NewFlexEncoder03(payloadType uint8, ssrc uint32) *FlexEncoder03 {
3636
}
3737

3838
// EncodeFec returns a list of generated RTP packets with FEC payloads that protect the specified mediaPackets.
39-
// This method return nil in case of missing RTP packets in the mediaPackets array or packets passed out of order.
39+
// This method returns nil in case of missing RTP packets in the mediaPackets array or packets passed out of order.
4040
func (flex *FlexEncoder03) EncodeFec(mediaPackets []rtp.Packet, numFecPackets uint32) []rtp.Packet {
4141
// Check if mediaPackets is empty
4242
if len(mediaPackets) == 0 {

pkg/flexfec/util/media_packet_iterator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,9 @@ func (m *MediaPacketIterator) Next() *rtp.Packet {
4848

4949
// First returns the first media packet to iterate through.
5050
func (m *MediaPacketIterator) First() *rtp.Packet {
51+
if len(m.coveredIndices) == 0 {
52+
return nil
53+
}
54+
5155
return &m.mediaPackets[m.coveredIndices[0]]
5256
}

0 commit comments

Comments
 (0)