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.
This commit is contained in:
Jan Schmidt 2018-06-30 00:56:29 +10:00
parent 10a37e0c35
commit 0fca02bb5e

View file

@ -221,21 +221,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;
@ -262,6 +255,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;