Problems with segment seek on audiotestsrc

Simon Berg ksb at fluffware.se
Sun May 13 05:32:38 PDT 2012


I'm using audiotestsrc together with a segment seek to produce silence
for a fixed number of samples. The seek uses GST_FORMAT_DEFAULT to get
the desired number of samples. 
The problem is that I sometimes get one samples less than expected.
As far as I'm able to tell this is because audiotestsrc use
GST_FORMAT_TIME internally, so the sample number from the event is first
converted to ns and than back to samples. The result is sometimes one
sample less due to rounding errors.

I think the problem can be solved by using
gst_util_uint64_scale_int_round instead of gst_util_uint64_scale_int
when converting from ns to samples.

I'm currently using 0.10.36, but the conversion seems to be done the
same way in current git.

Is there a workaround for this? Is there an alternative element to
generate silence?

simon




More information about the gstreamer-devel mailing list