multiqueue: Don't start new pads until parented

Start task on new source pads added at runtime after they
have been added to the element, not during activation.

This ensures the pads can post their CREATE stream-status
messages and the application can set thread priorities.

https://bugzilla.gnome.org/show_bug.cgi?id=756867
This commit is contained in:
Jan Alexander Steffens (heftig) 2017-12-15 09:14:57 +01:00 committed by Tim-Philipp Müller
parent 10c3a7bd55
commit b17d03cb0a

View file

@ -2502,7 +2502,7 @@ gst_multi_queue_src_activate_mode (GstPad * pad, GstObject * parent,
case GST_PAD_MODE_PUSH:
if (active) {
gst_single_queue_flush (mq, sq, FALSE, TRUE);
result = gst_single_queue_start (mq, sq);
result = parent ? gst_single_queue_start (mq, sq) : TRUE;
} else {
gst_single_queue_flush (mq, sq, TRUE, TRUE);
result = gst_single_queue_stop (mq, sq);
@ -3075,6 +3075,9 @@ gst_single_queue_new (GstMultiQueue * mqueue, guint id)
}
gst_element_add_pad (GST_ELEMENT (mqueue), sq->srcpad);
gst_element_add_pad (GST_ELEMENT (mqueue), sq->sinkpad);
if (GST_STATE_TARGET (mqueue) != GST_STATE_NULL) {
gst_single_queue_start (mqueue, sq);
}
g_rec_mutex_unlock (GST_STATE_GET_LOCK (mqueue));
GST_DEBUG_OBJECT (mqueue, "GstSingleQueue [%d] created and pads added",