Skip to content

Commit

Permalink
Apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LVala committed Apr 19, 2024
1 parent 49b3e31 commit 7b9ed3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/ex_webrtc/peer_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ defmodule ExWebRTC.PeerConnection do

@doc """
Send an RTP packet to the remote peer using specified track or its id.
Options:
* `rtx?` - send the packet as it was retransmited (use SSRC and payload type specific to RTX)
"""
@spec send_rtp(
peer_connection(),
Expand Down Expand Up @@ -1625,6 +1628,8 @@ defmodule ExWebRTC.PeerConnection do
nil ->
state

# in case NACK was received, but RTX was not negotiated
# as NACK and RTX are negotited independently
{%RTPTransceiver{sender: %RTPSender{rtx_pt: nil}}, _idx} ->
state

Expand Down
2 changes: 1 addition & 1 deletion test/ex_webrtc/rtp_sender/nack_responder_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule ExWebRTC.RTPReceiver.NACKResponderTest do
|> NACKResponder.record_packet(%{@packet | sequence_number: 39})
|> NACKResponder.record_packet(%{@packet | sequence_number: 40})

nack = NACK.from_sequence_numbers(@media_ssrc, @sender_ssrc, [38, 39])
nack = NACK.from_sequence_numbers(@media_ssrc, @sender_ssrc, [38, 39, 237])
{rtx_packets, nack_responder} = NACKResponder.get_rtx(nack_responder, nack)

assert nack_responder.seq_no == @responder.seq_no + 2
Expand Down

0 comments on commit 7b9ed3f

Please sign in to comment.