From 261122a674f26e632585f4c8988d305036e86971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Ro=C5=BCnawski?= <48837433+roznawsk@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:47:52 +0200 Subject: [PATCH] Fix handling RTCP when there is no track (#170) --- lib/ex_webrtc/peer_connection.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ex_webrtc/peer_connection.ex b/lib/ex_webrtc/peer_connection.ex index 4f2dcda..065d766 100644 --- a/lib/ex_webrtc/peer_connection.ex +++ b/lib/ex_webrtc/peer_connection.ex @@ -2063,6 +2063,9 @@ defmodule ExWebRTC.PeerConnection do nil -> {nil, state} + {%{sender: %{track: nil}}, _idx} -> + {nil, state} + # in case NACK was received, but RTX was not negotiated # as NACK and RTX are negotiated independently {%{sender: %{rtx_pt: nil}} = tr, _idx} -> @@ -2087,6 +2090,9 @@ defmodule ExWebRTC.PeerConnection do nil -> {nil, state} + {%{sender: %{track: nil}}, _idx} -> + {nil, state} + {tr, idx} -> tr = RTPTransceiver.receive_pli(tr, pli) transceivers = List.replace_at(state.transceivers, idx, tr)