[Bug 644284] New: Suspicious max_latency computation in gstbaseaudiosink.c

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Mar 8 23:21:55 PST 2011


https://bugzilla.gnome.org/show_bug.cgi?id=644284
  GStreamer | gst-plugins-base | 0.10.32

           Summary: Suspicious max_latency computation in
                    gstbaseaudiosink.c
    Classification: Desktop
           Product: GStreamer
           Version: 0.10.32
        OS/Version: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: blaise at willowgarage.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
      GNOME target: ---
     GNOME version: ---


I have been reviewing latency computation code to try to understand exactly
what the max_latency is (still working on that). While reviewing
gstbaseaudiosink.c, I came across the following code in the GST_QUERY_LATENCY
handling, which seems suspicious:

{{{
          min_latency =
              gst_util_uint64_scale_int (spec->seglatency * spec->segsize,
              GST_SECOND, spec->rate * spec->bytes_per_sample);
          GST_OBJECT_UNLOCK (basesink);

          /* we cannot go lower than the buffer size and the min peer latency
*/
          min_latency = min_latency + min_l;
          /* the max latency is the max of the peer, we can delay an infinite
           * amount of time. */
          max_latency = min_latency + (max_l == -1 ? 0 : max_l);
}}}

This code seems suspicious to me because in the case where max_l != 0, the
final value of max_latency is:
{{{
min_latency_0 + min_l + max_l
}}}
(where min_latency_0 is the value of min_latency returned by
gst_util_uint64_scale_int, and min_l and max_l are the latencies for the
upstream pipeline)

I am still trying to grasp the exact meaning of max_latency, but it seems very
suspicious to me that we would be adding min_l and max_l, so I thought I would
flag this computation. 

It seems likely to me that the author intended to be using min_latency_0 in the
max_latency computation, and forgot that min_latency had already been operated
on.

-- 
Configure bugmail: https://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