[Bug 656412] vorbisdec: discard starting samples according to granpos

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Dec 2 07:07:59 PST 2011


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

--- Comment #19 from Vincent Penquerc'h <vincent.penquerch at collabora.co.uk> 2011-12-02 15:07:52 UTC ---
> So, trying to do this without segment stuff brings us back to Comment #6, with
> some ts tricks/hacks, which can probably be thought of and might be
> special-case handled in a vorbisdec pre_push method or so.

Why ?
As an idealized example, say you have a Vorbis stream, where the third page
(which is the first data page, the first two being headers) consists of a
single Vorbis packet. Let this stream be 48000 Hz, and contain 4800 samples.
This packet will then be 0.1 seconds long, and that first page has a granpos
4800 if all samples have to be played. This will translate to a timestamp of
0.1 seconds.

Now, if there's a sample perfect cut to remove the first 0.05 seconds (half
that first packet), then the granpos of that first page will be set to 2400.
This will transate to a timestamp of 0.05, such that the notional ts of the
first half of the sampes will be negative.

If the vorbis decoder does not output these sampes, but only the 2400 from the
second half of the packet, everything wil match, since those "lost" sampes only
have a notional ts. No negative ts to represent. And since the Vorbis stream is
that way specificaly to cut off those first samples, it does make sense to me
to not output them.

AFAICT, this is a good way to solve this, and certainly less scary than to deal
with segments.

Same for Opus by the way - some samples at start are here only to prime the
predictor, and should not be output.

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