From d72c6e95ed019d65141cf9605285d6a5f318ea94 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Nov 2005 13:18:44 +0000 Subject: [PATCH] gst/base/gstbasesink.c: For the current position in stream time, we need to subtract accumulated time. Original commit message from CVS: * gst/base/gstbasesink.c: (gst_base_sink_get_position): For the current position in stream time, we need to subtract accumulated time. * gst/gstsystemclock.c: (gst_system_clock_async_thread): Release lock before calling the callback function of async entries. --- ChangeLog | 10 ++++++++++ gst/base/gstbasesink.c | 3 ++- gst/gstsystemclock.c | 3 +++ libs/gst/base/gstbasesink.c | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 397d9f3..7393fc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-11-18 Wim Taymans + + * gst/base/gstbasesink.c: (gst_base_sink_get_position): + For the current position in stream time, we need to subtract + accumulated time. + + * gst/gstsystemclock.c: (gst_system_clock_async_thread): + Release lock before calling the callback function of async + entries. + 2005-11-18 Andy Wingo * gst/net/gstnetclientclock.c (gst_net_client_clock_class_init): diff --git a/gst/base/gstbasesink.c b/gst/base/gstbasesink.c index 03fbcb8..73d2582 100644 --- a/gst/base/gstbasesink.c +++ b/gst/base/gstbasesink.c @@ -1480,7 +1480,8 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format, else segment_time = 0; - *cur = now - GST_ELEMENT_CAST (basesink)->base_time + segment_time; + *cur = now - GST_ELEMENT_CAST (basesink)->base_time - + basesink->segment_accum + segment_time; GST_DEBUG_OBJECT (basesink, "now %" GST_TIME_FORMAT " + segment_time %" GST_TIME_FORMAT " = %" diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index eedead7..c70a2d2 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -280,8 +280,11 @@ gst_system_clock_async_thread (GstClock * clock) * entry */ GST_CAT_DEBUG (GST_CAT_CLOCK, "async entry %p unlocked", entry); if (entry->func) { + /* unlock before firing the callback */ + GST_UNLOCK (clock); entry->func (clock, entry->time, (GstClockID) entry, entry->user_data); + GST_LOCK (clock); } if (entry->type == GST_CLOCK_ENTRY_PERIODIC) { /* adjust time now */ diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 03fbcb8..73d2582 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -1480,7 +1480,8 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format, else segment_time = 0; - *cur = now - GST_ELEMENT_CAST (basesink)->base_time + segment_time; + *cur = now - GST_ELEMENT_CAST (basesink)->base_time - + basesink->segment_accum + segment_time; GST_DEBUG_OBJECT (basesink, "now %" GST_TIME_FORMAT " + segment_time %" GST_TIME_FORMAT " = %" -- 2.7.4