mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
sctpenc: start pad task after the parent has activated pads
Fixes a race where the task could attempt to set stream-start/caps/segment before the pad was active and would be dropped resulting in a 'data-flow before stream-start' warning.
This commit is contained in:
parent
88b4ce9fc0
commit
fb8f7c25de
1 changed files with 17 additions and 6 deletions
|
@ -336,22 +336,16 @@ gst_sctp_enc_change_state (GstElement * element, GstStateChange transition)
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
self->need_segment = self->need_stream_start_caps = TRUE;
|
self->need_segment = self->need_stream_start_caps = TRUE;
|
||||||
gst_data_queue_set_flushing (self->outbound_sctp_packet_queue, FALSE);
|
gst_data_queue_set_flushing (self->outbound_sctp_packet_queue, FALSE);
|
||||||
gst_pad_start_task (self->src_pad,
|
|
||||||
(GstTaskFunction) gst_sctp_enc_srcpad_loop, self->src_pad, NULL);
|
|
||||||
res = configure_association (self);
|
res = configure_association (self);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
sctpenc_cleanup (self);
|
sctpenc_cleanup (self);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -361,6 +355,23 @@ gst_sctp_enc_change_state (GstElement * element, GstStateChange transition)
|
||||||
if (res)
|
if (res)
|
||||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
|
switch (transition) {
|
||||||
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
|
gst_pad_start_task (self->src_pad,
|
||||||
|
(GstTaskFunction) gst_sctp_enc_srcpad_loop, self->src_pad, NULL);
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue