mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-04 03:03:54 +00:00
libs/gst/base/gstbasesink.c: Fix position query range checks in reverse playback.
Original commit message from CVS: * libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times), (gst_base_sink_get_position_last), (gst_base_sink_get_position): Fix position query range checks in reverse playback.
This commit is contained in:
parent
3edb63d2ed
commit
5cba5bdbf1
2 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-05-29 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times),
|
||||||
|
(gst_base_sink_get_position_last), (gst_base_sink_get_position):
|
||||||
|
Fix position query range checks in reverse playback.
|
||||||
|
|
||||||
2008-05-29 Sebastian Dröge <slomo@circular-chaos.org>
|
2008-05-29 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst/gstelement.c:
|
* gst/gstelement.c:
|
||||||
|
|
|
@ -1302,7 +1302,11 @@ gst_base_sink_get_sync_times (GstBaseSink * basesink, GstMiniObject * obj,
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
/* EOS event needs syncing */
|
/* EOS event needs syncing */
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
|
if (basesink->segment.rate >= 0.0)
|
||||||
sstart = sstop = priv->current_sstop;
|
sstart = sstop = priv->current_sstop;
|
||||||
|
else
|
||||||
|
sstart = sstop = priv->current_sstart;
|
||||||
|
|
||||||
rstart = rstop = priv->eos_rtime;
|
rstart = rstop = priv->eos_rtime;
|
||||||
*do_sync = rstart != -1;
|
*do_sync = rstart != -1;
|
||||||
GST_DEBUG_OBJECT (basesink, "sync times for EOS %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (basesink, "sync times for EOS %" GST_TIME_FORMAT,
|
||||||
|
@ -3036,6 +3040,7 @@ gst_base_sink_get_position_last (GstBaseSink * basesink, gint64 * cur)
|
||||||
{
|
{
|
||||||
/* return last observed stream time */
|
/* return last observed stream time */
|
||||||
*cur = basesink->priv->current_sstop;
|
*cur = basesink->priv->current_sstop;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basesink, "POSITION: %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (basesink, "POSITION: %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (*cur));
|
GST_TIME_ARGS (*cur));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -3159,11 +3164,16 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
|
||||||
* duration. */
|
* duration. */
|
||||||
if (rate < 0.0)
|
if (rate < 0.0)
|
||||||
time += duration;
|
time += duration;
|
||||||
|
|
||||||
*cur = time + gst_guint64_to_gdouble (now - base) * rate;
|
*cur = time + gst_guint64_to_gdouble (now - base) * rate;
|
||||||
|
|
||||||
/* never report more than last seen position */
|
/* never report more than last seen position */
|
||||||
if (last != -1)
|
if (last != -1) {
|
||||||
|
if (rate < 0.0)
|
||||||
*cur = MIN (last, *cur);
|
*cur = MIN (last, *cur);
|
||||||
|
else
|
||||||
|
*cur = MAX (last, *cur);
|
||||||
|
}
|
||||||
|
|
||||||
gst_object_unref (clock);
|
gst_object_unref (clock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue