[gstreamer-bugs] [Bug 591934] New: timestamp drift in audioresample

bugzilla at gnome.org bugzilla at gnome.org
Sat Aug 15 19:07:34 PDT 2009


http://bugzilla.gnome.org/show_bug.cgi?id=591934

           Summary: timestamp drift in audioresample
    Classification: Desktop
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: kcannon at ligo.caltech.edu
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


--- Comment #0 from Kipp <kcannon at ligo.caltech.edu> 2009-08-16 02:07:31 UTC ---
The audioresample element uses a running total of the durations of past output
buffers to compute the timestamp of each new output buffer.  For buffers whose
lengths are not an integer number of nanoseconds, this results in an
accumulation of round-off error, and a growing phase error in the output.

The patch attached fixes the problem by re-working the timestamp and offset
book-keeping.  the next_offset, next_ts and next_upstream_ts in the element
instance are replaced with t0, in_offset0, out_offset0, next_in_offset, and
next_out_offset.

t0 and in_offset0 are the timestamp and sample offset at the input at the most
recent stream discontinuity (or new segment).  out_offset0 is computed from
in_offset0 by scaling by the ratio of the sample rates, and is the output
sample offset at the most recent stream discontinuity.

next_in_offset and next_out_offset are initialized to in_offset0 and
out_offset0 respectively, and are incremented as samples are clocked through
the resampler.  They always indicate the start offset of the next expected
input and output buffers respectively.  Non-flagged discontinuities are
identified by comparing the observed input offset to the expected input offset,
next_in_offset.  The timestamp of each output buffer is computed from the
number of output samples that have been produced so far,
(next_out_offset-out_offset0), the sample rate, and t0 (the timestamp when the
offset was out_offset0).

t0 is set to GST_CLOCK_TIME_NONE if no valid timestamp information has been
extracted from the input stream.

This patch relies on bug #590919, and obsoletes the patches in bug #586570
(which we will re-work and re-submit after this problem is resolved).

-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list