From 6a80d3c4ea9d7888cb50268d8da2fb49bfe409c6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 12 Dec 2005 10:16:11 +0000 Subject: [PATCH] libs/gst/base/gstbasesink.c: Take current playback rate into account when reporting the position. Original commit message from CVS: * libs/gst/base/gstbasesink.c: (gst_base_sink_get_position): Take current playback rate into account when reporting the position. --- ChangeLog | 6 ++++++ libs/gst/base/gstbasesink.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8427d123d0..a6e192041b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-12-12 Wim Taymans + + * libs/gst/base/gstbasesink.c: (gst_base_sink_get_position): + Take current playback rate into account when reporting + the position. + 2005-12-11 Tim-Philipp Müller * docs/manual/mime-world.fig: diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index d93307cb30..382a2beca6 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -1366,7 +1366,9 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format, time = 0; base = GST_ELEMENT_CAST (basesink)->base_time; - *cur = now - base - basesink->segment.accum + time; + base += basesink->segment.accum; + base = MIN (now, base); + *cur = (now - base) * basesink->segment.abs_rate + time; GST_DEBUG_OBJECT (basesink, "now %" GST_TIME_FORMAT " - base %" GST_TIME_FORMAT " - accum %"