mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
aggregator: fix start time selection first with force-live
When force-live is true, we don't want to wait for a first buffer to select a start time. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1783 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7752>
This commit is contained in:
parent
ff16221df5
commit
eb825574f4
1 changed files with 19 additions and 0 deletions
|
@ -879,6 +879,25 @@ gst_aggregator_wait_and_check (GstAggregator * self, gboolean * timeout)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self->priv->force_live && self->priv->first_buffer
|
||||||
|
&& self->priv->start_time_selection ==
|
||||||
|
GST_AGGREGATOR_START_TIME_SELECTION_FIRST) {
|
||||||
|
GstClockTime start_time;
|
||||||
|
GstAggregatorPad *srcpad = GST_AGGREGATOR_PAD (self->srcpad);
|
||||||
|
start_time = gst_element_get_current_running_time (GST_ELEMENT (self));
|
||||||
|
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (start_time)) {
|
||||||
|
if (srcpad->segment.position == -1)
|
||||||
|
srcpad->segment.position = start_time;
|
||||||
|
else
|
||||||
|
srcpad->segment.position = MIN (start_time, srcpad->segment.position);
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (self, "Selecting start time %" GST_TIME_FORMAT,
|
||||||
|
GST_TIME_ARGS (start_time));
|
||||||
|
self->priv->first_buffer = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
start = gst_aggregator_get_next_time (self);
|
start = gst_aggregator_get_next_time (self);
|
||||||
|
|
||||||
/* If we're not live, or if we use the running time
|
/* If we're not live, or if we use the running time
|
||||||
|
|
Loading…
Reference in a new issue