webrtcbin: Return the old state if we ended up being in an unspecified situation
authorSebastian Dröge <sebastian@centricular.com>
Sun, 12 Jan 2020 14:32:20 +0000 (16:32 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 19 Jan 2020 11:16:34 +0000 (11:16 +0000)
Previously we would've returned NEW, which is usually more wrong.

ext/webrtc/gstwebrtcbin.c

index 165c6a8..11cff80 100644 (file)
@@ -885,8 +885,8 @@ _collate_ice_connection_states (GstWebRTCBin * webrtc)
     return STATE (CONNECTED);
   }
 
-  GST_FIXME ("unspecified situation, returning new");
-  return STATE (NEW);
+  GST_FIXME ("unspecified situation, returning old state");
+  return webrtc->ice_connection_state;
 #undef STATE
 }
 
@@ -1115,8 +1115,9 @@ _collate_peer_connection_states (GstWebRTCBin * webrtc)
     return STATE (CONNECTED);
   }
 
-  GST_FIXME_OBJECT (webrtc, "Undefined situation detected, returning new");
-  return STATE (NEW);
+  GST_FIXME_OBJECT (webrtc,
+      "Undefined situation detected, returning old state");
+  return webrtc->peer_connection_state;
 #undef DTLS_STATE
 #undef ICE_STATE
 #undef STATE