[Bug 719357] audiobasesink: does not drop late buffers

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Dec 19 11:52:52 PST 2013


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

Wim Taymans <wim.taymans> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wim.taymans at gmail.com

--- Comment #8 from Wim Taymans <wim.taymans at gmail.com> 2013-12-19 19:52:49 UTC ---
I think the original code was correct. The idea is that when we have calculated
that the next sample should be played at ->next_sample and the new sample at
sample_offset, we have:

headroom: the diff between ringbuffer read pointer and our sample_offset. This
should be positive if we are writing before the ringbuffer readpointer (and
want to have a chance to hear the sample still)

sample_diff: absolute diff between ->next_sample and sample_offset. Or the
error between what we expected to receive and what we received.

align = sink->next_sample - sample_offset; ==0 means perfect, < 0 means the
sample is to be played later than expected and thus alignment would play the
sample earlier, > 0 the sample is to be played sooner than expected and thus
alignment would delay playback.

The we have:

  /* don't align if it means writing behind the read-segment */
  if (sample_diff > headroom && align < 0)
    allow_align = FALSE;

If the sample error is bigger than the diff between read and write pointer
*and* alignment would make us play the sample earlier (earlier than the
headroom, thus before the read pointer) then we don't align.

This makes sense because aligning to before the read pointer would 1) play the
sample wrongly (it would be aligned) 2) it would simply drop the sample because
the ringbuffer has already read past the sample. 

What exactly is it that you think is wrong?

-- 
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