audioresample is derived from GstBaseTransform, and one of
GstBaseTransform's traits is that if the derived element does not
produce an output buffer from some input buffer then the first output
buffer after that gets flaged as a discontinuity, whether or not the
buffer actually is discontinuous from the output buffer that preceded
it. When downsampling, the audioresample element requires more than
one input sample for each output sample, and if the ratio of input to
output sample rates is high enough and the input buffers short enough
it can come to pass that the resampler does not receive enough samples
on its input to produce any output. Currently the resampler returns
GST_BASE_TRANSFORM_FLOW_DROPPED from the transform() method in this case,
causing the next buffer to be flagged as a discontinuity. If subsequent
elements in the pipeline reset themselves on disconts, this can cause
clicks and other undesireable behaviour.
Fixes bug #665004.
Remove the android/ top dir
Fixe the Makefile.am to be androgenized
To build gstreamer for android we are now using androgenizer which generates the
needed Android.mk files.
Androgenizer can be found here:
http://git.collabora.co.uk/?p=user/derek/androgenizer.git
Since we calculate timestamps by:
timestamp = t0 + (out samples) / (out rate)
and durations by:
duration = ((out samples) + (processed samples)) / (out rate) - timestamp
if t0 is nonzero, this would simplify to
duration = t0 + (processed samples) / (out rate).
This duration is too large by the amount t0. We should have done:
duration = t0 + ((out samples) + (processed samples)) / (out rate) - timestamp
so that
duration = (processed samples) / (out rate).
Orc is not a hard requirement. Things should still compile and
work without orc, but slow fallback code may be used in this
case. Fix up configure to not error out if orc is not installed
and wrap use of orc profiling in audioresample in #ifdefs.
Fixes#620136 some more.
When calculating the input/output buffer sizes in the transform_size function,
take the number of channels into account, so we don't end up calculating
a buffer size that only contains a partial number of audio frames.
Also, when going from output size to input size, round down rather than
up, so as to calculate the minimum number of samples that *might* yield
a buffer of the intended destination size.
Fixes: #580470 and #580952
If one side has a preference for a particular sample rate or set of sample rates, we
should honour this in the caps we advertise and transform to and from, so that elements
actually know about the other side's sample rate preference and can negotiate to it
if supported. Also add unit test for this.
When setting the quality/filter-length while PLAYING the
resampling context will be destroyed and created again in
some cases, which will cause crashes in the transform function
if it's called at that time.
Original commit message from CVS:
* gst/audioresample/gstaudioresample.c:
Guard against a NULL dereference I somehow encountered -
with a FLUSH_STOP arriving either before basetransform _start(),
or after _stop().
* gst/typefind/gsttypefindfunctions.c:
Make sure we never jump backwards when typefinding corrupt mov files.
Original commit message from CVS:
* gst/audioresample/gstaudioresample.c:
(gst_audioresample_class_init), (audioresample_fixate_caps):
Fixate the rate to the nearest supported rate instead of
the first one. Fixes bug #549510.