agent: Simplify accepting state changes to FAILED
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 20 Jul 2021 17:06:58 +0000 (13:06 -0400)
committerOlivier Crête <olivier.crete@ocrete.ca>
Tue, 20 Jul 2021 22:46:37 +0000 (22:46 +0000)
The component can go from any state to FAILED, so simplify
that and make it explicit.

agent/agent.c

index 261fe64..2549bac 100644 (file)
@@ -2573,11 +2573,7 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
   g_assert (/* Can (almost) always transition to FAILED (including
              * DISCONNECTED → FAILED which happens if one component fails
              * before another leaves DISCONNECTED): */
-            TRANSITION (DISCONNECTED, FAILED) ||
-            TRANSITION (GATHERING, FAILED) ||
-            TRANSITION (CONNECTING, FAILED) ||
-            TRANSITION (CONNECTED, FAILED) ||
-            TRANSITION (READY, FAILED) ||
+            (new_state == NICE_COMPONENT_STATE_FAILED) ||
             /* Standard progression towards a ready connection: */
             TRANSITION (DISCONNECTED, GATHERING) ||
             TRANSITION (GATHERING, CONNECTING) ||