summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2018-06-30 00:56:29 +1000
committerJan Schmidt <jan@centricular.com>2018-07-05 00:19:40 +1000
commit9f2e0c7cddeaa0fc0d7629af5a3d54199a501338 (patch)
treef964d3527cc82146c05a7f19946b34d7a8ceb746
parent3e2fb0d8b38a3930cf2730d6f556ea2a94e17f71 (diff)
downloadgstreamer-plugins-bad-9f2e0c7cddeaa0fc0d7629af5a3d54199a501338.tar.gz
webrtc: Move the transportsendbin pad block removal
Move freeing of the pad blocks back to before we call the GstBin state change function, as there's something racy going on on the build server otherwise, where the pads don't unblock during downward state changes. This is a bit of a stab in the dark, since I can't recreate the build server failure locally.
-rw-r--r--ext/webrtc/transportsendbin.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/ext/webrtc/transportsendbin.c b/ext/webrtc/transportsendbin.c
index 67f1c9a72..daddd3b96 100644
--- a/ext/webrtc/transportsendbin.c
+++ b/ext/webrtc/transportsendbin.c
@@ -219,21 +219,14 @@ transport_send_bin_change_state (GstElement * element,
gst_object_unref (pad);
break;
}
- default:
- break;
- }
-
- ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
- if (ret == GST_STATE_CHANGE_FAILURE)
- return ret;
-
- /* Do downward state change cleanups after the element
- * has been stopped, as this will have set pads to flushing as needed
- * and unblocked any pad probes that are blocked */
- switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
{
- /* Release pad blocks */
+ /* Normally, we do downward state change cleanups after the element
+ * has been stopped, as this will have set pads to flushing as needed
+ * and unblocked any pad probes that are blocked, but sometimes that's
+ * causing a deadlock on the build server in tests, with a race around
+ * the pad blocking/release timing, so free the pad blocks before
+ * stopping everything */
if (send->rtp_block && send->rtp_block->block_id) {
gst_pad_remove_probe (send->rtp_block->pad, send->rtp_block->block_id);
send->rtp_block->block_id = 0;
@@ -260,6 +253,15 @@ transport_send_bin_change_state (GstElement * element,
}
break;
}
+ default:
+ break;
+ }
+
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+ if (ret == GST_STATE_CHANGE_FAILURE)
+ return ret;
+
+ switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:{
GstElement *elem;