mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
libs/gst/base/gstbasesink.c: Don't try to preroll non-async elements after a flush.
Original commit message from CVS: * libs/gst/base/gstbasesink.c: (gst_base_sink_event), (gst_base_sink_get_position): Don't try to preroll non-async elements after a flush. Subtract latency form clock times when reporting position.
This commit is contained in:
parent
731f14c4b9
commit
71f92e2b3e
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-10-08 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
* libs/gst/base/gstbasesink.c: (gst_base_sink_event),
|
||||||
|
(gst_base_sink_get_position):
|
||||||
|
Don't try to preroll non-async elements after a flush.
|
||||||
|
Subtract latency form clock times when reporting position.
|
||||||
|
|
||||||
2007-10-05 Wim Taymans <wim.taymans@gmail.com>
|
2007-10-05 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* gst/gstpad.c: (gst_pad_pause_task):
|
* gst/gstpad.c: (gst_pad_pause_task):
|
||||||
|
|
|
@ -2216,6 +2216,7 @@ gst_base_sink_event (GstPad * pad, GstEvent * event)
|
||||||
gst_element_lost_state (GST_ELEMENT_CAST (basesink));
|
gst_element_lost_state (GST_ELEMENT_CAST (basesink));
|
||||||
} else {
|
} else {
|
||||||
basesink->priv->have_latency = TRUE;
|
basesink->priv->have_latency = TRUE;
|
||||||
|
basesink->need_preroll = FALSE;
|
||||||
}
|
}
|
||||||
GST_PAD_STREAM_UNLOCK (pad);
|
GST_PAD_STREAM_UNLOCK (pad);
|
||||||
|
|
||||||
|
@ -2809,7 +2810,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
/* we can answer time format */
|
/* we can answer time format */
|
||||||
case GST_FORMAT_TIME:
|
case GST_FORMAT_TIME:
|
||||||
{
|
{
|
||||||
GstClockTime now, base;
|
GstClockTime now, base, latency;
|
||||||
gint64 time, accum, duration;
|
gint64 time, accum, duration;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
gint64 last;
|
gint64 last;
|
||||||
|
@ -2854,6 +2855,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
accum = basesink->segment.accum;
|
accum = basesink->segment.accum;
|
||||||
rate = basesink->segment.rate * basesink->segment.applied_rate;
|
rate = basesink->segment.rate * basesink->segment.applied_rate;
|
||||||
gst_base_sink_get_position_last (basesink, &last);
|
gst_base_sink_get_position_last (basesink, &last);
|
||||||
|
latency = basesink->priv->latency;
|
||||||
|
|
||||||
gst_object_ref (clock);
|
gst_object_ref (clock);
|
||||||
/* need to release the object lock before we can get the time,
|
/* need to release the object lock before we can get the time,
|
||||||
|
@ -2862,11 +2864,13 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
GST_OBJECT_UNLOCK (basesink);
|
GST_OBJECT_UNLOCK (basesink);
|
||||||
|
|
||||||
now = gst_clock_get_time (clock);
|
now = gst_clock_get_time (clock);
|
||||||
|
|
||||||
/* subtract base time and accumulated time from the clock time.
|
/* subtract base time and accumulated time from the clock time.
|
||||||
* Make sure we don't go negative. This is the current time in
|
* Make sure we don't go negative. This is the current time in
|
||||||
* the segment which we need to scale with the combined
|
* the segment which we need to scale with the combined
|
||||||
* rate and applied rate. */
|
* rate and applied rate. */
|
||||||
base += accum;
|
base += accum;
|
||||||
|
base += latency;
|
||||||
base = MIN (now, base);
|
base = MIN (now, base);
|
||||||
|
|
||||||
/* for negative rates we need to count back from from the segment
|
/* for negative rates we need to count back from from the segment
|
||||||
|
|
Loading…
Reference in a new issue