mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-07 15:15:53 +00:00
plugins/elements/gstmultiqueue.c: Don't update the cur_time on GST_CLOCK_TIME_NONE (#537804) and don't activate the p...
Original commit message from CVS: * plugins/elements/gstmultiqueue.c: Don't update the cur_time on GST_CLOCK_TIME_NONE (#537804) and don't activate the pads if they are added in STATE_NULL.
This commit is contained in:
parent
8442b73552
commit
d7d1eecb97
|
@ -1,3 +1,9 @@
|
||||||
|
2008-06-22 Thijs Vermeir <thijsvermeir@gmail.com>
|
||||||
|
|
||||||
|
* plugins/elements/gstmultiqueue.c:
|
||||||
|
Don't update the cur_time on GST_CLOCK_TIME_NONE (#537804) and don't
|
||||||
|
activate the pads if they are added in STATE_NULL.
|
||||||
|
|
||||||
2008-06-21 Thijs Vermeir <thijsvermeir@gmail.com>
|
2008-06-21 Thijs Vermeir <thijsvermeir@gmail.com>
|
||||||
|
|
||||||
* docs/libs/gstreamer-libs-sections.txt:
|
* docs/libs/gstreamer-libs-sections.txt:
|
||||||
|
|
|
@ -625,9 +625,13 @@ update_time_level (GstMultiQueue * mq, GstSingleQueue * sq)
|
||||||
sink_time =
|
sink_time =
|
||||||
gst_segment_to_running_time (&sq->sink_segment, GST_FORMAT_TIME,
|
gst_segment_to_running_time (&sq->sink_segment, GST_FORMAT_TIME,
|
||||||
sq->sink_segment.last_stop);
|
sq->sink_segment.last_stop);
|
||||||
|
if (sink_time == GST_CLOCK_TIME_NONE)
|
||||||
|
goto beach;
|
||||||
|
|
||||||
src_time = gst_segment_to_running_time (&sq->src_segment, GST_FORMAT_TIME,
|
src_time = gst_segment_to_running_time (&sq->src_segment, GST_FORMAT_TIME,
|
||||||
sq->src_segment.last_stop);
|
sq->src_segment.last_stop);
|
||||||
|
if (src_time == GST_CLOCK_TIME_NONE)
|
||||||
|
goto beach;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mq,
|
GST_DEBUG_OBJECT (mq,
|
||||||
"queue %d, sink %" GST_TIME_FORMAT ", src %" GST_TIME_FORMAT, sq->id,
|
"queue %d, sink %" GST_TIME_FORMAT ", src %" GST_TIME_FORMAT, sq->id,
|
||||||
|
@ -635,10 +639,14 @@ update_time_level (GstMultiQueue * mq, GstSingleQueue * sq)
|
||||||
|
|
||||||
/* This allows for streams with out of order timestamping - sometimes the
|
/* This allows for streams with out of order timestamping - sometimes the
|
||||||
* emerging timestamp is later than the arriving one(s) */
|
* emerging timestamp is later than the arriving one(s) */
|
||||||
if (sink_time >= src_time)
|
if (sink_time < src_time)
|
||||||
sq->cur_time = sink_time - src_time;
|
goto beach;
|
||||||
else
|
|
||||||
sq->cur_time = 0;
|
sq->cur_time = sink_time - src_time;
|
||||||
|
return;
|
||||||
|
|
||||||
|
beach:
|
||||||
|
sq->cur_time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* take a NEWSEGMENT event and apply the values to segment, updating the time
|
/* take a NEWSEGMENT event and apply the values to segment, updating the time
|
||||||
|
@ -1475,11 +1483,17 @@ gst_single_queue_new (GstMultiQueue * mqueue)
|
||||||
gst_pad_set_element_private (sq->sinkpad, (gpointer) sq);
|
gst_pad_set_element_private (sq->sinkpad, (gpointer) sq);
|
||||||
gst_pad_set_element_private (sq->srcpad, (gpointer) sq);
|
gst_pad_set_element_private (sq->srcpad, (gpointer) sq);
|
||||||
|
|
||||||
gst_pad_set_active (sq->srcpad, TRUE);
|
/* only activate the pads when we are not in the NULL state
|
||||||
|
* and add the pad under the state_lock to prevend state changes
|
||||||
|
* between activating and adding */
|
||||||
|
g_static_rec_mutex_lock (GST_STATE_GET_LOCK (mqueue));
|
||||||
|
if (GST_STATE_TARGET (mqueue) != GST_STATE_NULL) {
|
||||||
|
gst_pad_set_active (sq->srcpad, TRUE);
|
||||||
|
gst_pad_set_active (sq->sinkpad, TRUE);
|
||||||
|
}
|
||||||
gst_element_add_pad (GST_ELEMENT (mqueue), sq->srcpad);
|
gst_element_add_pad (GST_ELEMENT (mqueue), sq->srcpad);
|
||||||
|
|
||||||
gst_pad_set_active (sq->sinkpad, TRUE);
|
|
||||||
gst_element_add_pad (GST_ELEMENT (mqueue), sq->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (mqueue), sq->sinkpad);
|
||||||
|
g_static_rec_mutex_unlock (GST_STATE_GET_LOCK (mqueue));
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (mqueue, "GstSingleQueue [%d] created and pads added",
|
GST_DEBUG_OBJECT (mqueue, "GstSingleQueue [%d] created and pads added",
|
||||||
sq->id);
|
sq->id);
|
||||||
|
|
Loading…
Reference in a new issue