[gst-devel] Re: [gst-cvs] rbultje gst-plugins: gst-plugins/ gst-plugins/sys/oss/

Ronald S. Bultje rbultje at ronald.bitfreak.net
Sun Oct 24 07:16:05 CEST 2004

On Sun, 2004-10-24 at 16:04, Ronald S. Bultje wrote:
> * sys/oss/gstosssrc.c: (gst_osssrc_get):
> Don't mix bytes and samples.

I'm gonna piss off the flumotion people here, but the revert of their
patch is on purpose. It breaks too many other things.

For those who don't know, short expl.: GST_BUFFER_OFFSET_END() indicates
the offset of the end of the buffer (so begin + size), but nothing
specifies the format. The patch from some time ago converts this into
samples for osssrc (see below), whereas it used to be in bytes before
that. Both would be equally correct and incorrect. The breakage is that
they used osssrc->curoffset for this, which is specified to be in bytes.
they moved it to be in samples without converting the rest of the code
to it, breaking the clock provided by osssrc, breaking osssrc querying
and breaking timestamps in osssrc. Those aren't noticeable in gst-launch
pipelines, but they are noticeable in larger applications that use this
(e.g. gst-rec. ;-) ).

Ogg needs a "granulepos", which is a offset of the end of the buffer of
the given page in units specific to the format (can this be more vague?
:-) ). The patch to OFFSET_END() above converts it into samples, which
is by accident what vorbis expects. However, I think that's wrong. If
vorbis and ogg need a granulepos, then let *them* keep track of
granulepos. Don't "fix" or "break" (it's the same, really) other
elements to do what vorbis expects. It's wrong. My suggestion is to
either keep a counter in vorbisenc or to use querying for this (using
GST_FORMAT_DEFAULT), both work for osssrc.

If we (together, not you alone) decide to use OFFSET_END() for this,
then document that, fix it in *all* elements and not just in two, and
fix the rest of all those elements as well to have working clocking,
querying and timing.



Ronald S. Bultje <rbultje at ronald.bitfreak.net>

More information about the gstreamer-devel mailing list