Problems with segment seek on audiotestsrc

Stefan Sauer ensonic at hora-obscura.de
Sun May 20 12:52:35 PDT 2012


On 05/13/2012 02:32 PM, Simon Berg wrote:
> 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
>
>
Could you please file a bug for this? One workaround would be to do the
time conversion on your side and use GST_FORMAT_TIME when seeking.

Stefan


More information about the gstreamer-devel mailing list