aboutsummaryrefslogtreecommitdiff
path: root/plugins/ice/src/transport_parameters.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-03-23 15:09:52 +0100
committerMarvin W <git@larma.de>2021-03-23 15:11:00 +0100
commit97ab7de7ab4f958eb7d273e524151007d44ea1d7 (patch)
tree76d8fa9ca106be411bd61d0e1d910267ba77eaec /plugins/ice/src/transport_parameters.vala
parentb01f6f9ef7c0e8b0a15149426a47a238a5f6f1ce (diff)
downloaddino-97ab7de7ab4f958eb7d273e524151007d44ea1d7.tar.gz
dino-97ab7de7ab4f958eb7d273e524151007d44ea1d7.zip
Mark ICE component as ready even without the event
Diffstat (limited to 'plugins/ice/src/transport_parameters.vala')
-rw-r--r--plugins/ice/src/transport_parameters.vala13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/ice/src/transport_parameters.vala b/plugins/ice/src/transport_parameters.vala
index 467b3674..a8172678 100644
--- a/plugins/ice/src/transport_parameters.vala
+++ b/plugins/ice/src/transport_parameters.vala
@@ -172,7 +172,12 @@ public class Dino.Plugins.Ice.TransportParameters : JingleIceUdp.IceUdpTransport
private void on_component_state_changed(uint stream_id, uint component_id, uint state) {
if (stream_id != this.stream_id) return;
debug("stream %u component %u state changed to %s", stream_id, component_id, agent.get_component_state(stream_id, component_id).to_string());
- if (is_component_ready(agent, stream_id, component_id) && connections.has_key((uint8) component_id) && !connections[(uint8)component_id].ready) {
+ may_consider_ready(stream_id, component_id);
+ }
+
+ private void may_consider_ready(uint stream_id, uint component_id) {
+ if (stream_id != this.stream_id) return;
+ if (connections.has_key((uint8) component_id) && is_component_ready(agent, stream_id, component_id) && connections.has_key((uint8) component_id) && !connections[(uint8)component_id].ready) {
connections[(uint8)component_id].ready = true;
}
}
@@ -189,7 +194,11 @@ public class Dino.Plugins.Ice.TransportParameters : JingleIceUdp.IceUdpTransport
private void on_recv(Nice.Agent agent, uint stream_id, uint component_id, uint8[] data) {
if (stream_id != this.stream_id) return;
- if (is_component_ready(agent, stream_id, component_id) && connections.has_key((uint8) component_id)) {
+ may_consider_ready(stream_id, component_id);
+ if (connections.has_key((uint8) component_id)) {
+ if (!connections[(uint8) component_id].ready) {
+ debug("on_recv stream %u component %u when state %s", stream_id, component_id, agent.get_component_state(stream_id, component_id).to_string());
+ }
connections[(uint8) component_id].datagram_received(new Bytes(data));
} else {
debug("on_recv stream %u component %u length %u", stream_id, component_id, data.length);