After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602419 - [basesink] Regression with position reporting
[basesink] Regression with position reporting
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other Linux
: Normal blocker
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-19 16:02 UTC by Sebastian Dröge (slomo)
Modified: 2009-11-19 18:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2009-11-19 16:02:40 UTC
Hi,
see bug #585969 comment #7.

This is caused by this commit http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=f83ea8233bf1661bdab0d4ec6f08169d7c664452

Position reporting between the group switch results in:
[...]
0:00:04.913886000 / 0:00:06.965986394
0:00:05.412122000 / 0:00:06.965986394
0:00:01.000000000 / 0:00:05.804988662
0:00:00.420986000 / 0:00:05.804988662
0:00:00.921070000 / 0:00:05.804988662
[...]

That weird 1 second is caused by the base time being larger (6965986394) than the clock time (6717317000), resulting in GST_CLOCK_DIFF (base, now) < 0.

Then basetime is set to -clocktime and a few times later the position is calulated as follows:
*cur = time + gst_guint64_to_gdouble (now - base) * rate;
Comment 1 Sebastian Dröge (slomo) 2009-11-19 16:04:55 UTC
Oh, and the 1.0 comes from:

  /* never report more than last seen position */
  if (last != -1)
    *cur = MIN (last, *cur);


Last seen position was 1 second in my case
Comment 2 Sebastian Dröge (slomo) 2009-11-19 16:24:08 UTC
On IRC Jan said, that this could be the right thing:

   if (GST_CLOCK_DIFF (base, now) < 0)
-    base = -now;
+    base = now;


Fixes this bug at least.
Comment 3 Jan Schmidt 2009-11-19 18:10:37 UTC
I think this should fix it:

commit 81d3fda6e85181f11e0acb4fcaf60ac49a6e9aac
Author: Jan Schmidt <thaytan@noraisin.net>
Date:   Thu Nov 19 19:00:05 2009 +0100

    basesink: Clamp the base time correctly in position reporting
    
    When clamping the base time, correctly use 'now', instead of
    '-now' - the intent is to prevent 'now-base' ever being
    negative, which would cause a position report outside the segment.
    
    Fixes: #602419
Comment 4 Sebastian Dröge (slomo) 2009-11-19 18:31:30 UTC
Yes, that fixes it