gst/base/gstbasesink.c: For the current position in stream time, we need to subtract...
authorWim Taymans <wim.taymans@gmail.com>
Fri, 18 Nov 2005 13:18:44 +0000 (13:18 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 18 Nov 2005 13:18:44 +0000 (13:18 +0000)
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
gst/base/gstbasesink.c
gst/gstsystemclock.c
libs/gst/base/gstbasesink.c

index 397d9f3..7393fc3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-11-18  Wim Taymans  <wim@fluendo.com>
+
+       * 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  <wingo@pobox.com>
 
        * gst/net/gstnetclientclock.c (gst_net_client_clock_class_init):
index 03fbcb8..73d2582 100644 (file)
@@ -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 " = %"
index eedead7..c70a2d2 100644 (file)
@@ -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 */
index 03fbcb8..73d2582 100644 (file)
@@ -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 " = %"