resample: Fix input indexing bug from interleaved functions
resample: Fix input indexing bug from interleaved functions

This bug happens quite often when resampling from a low to a high
sample-rate with big enough factor. Also the resampling call has to
be limited by the output buffer size and some unused samples needs be
left in the input buffer.

Sometimes when up-sampling with a big factor the resampling function
wants to peek one more sample from the input buffer to produce one
more output sample, but the inputs sample is not consumed because it
is also needed to produce the next output sample. When resampling the
next channel this peeked sample is not any more available because
*in_len parameter value was updated when resampling the first channel.
Cherry-pick from ICS to JB.

Change-Id: I2f1ad8a9cda2e439abaa860c697e11844b8a4347
Signed-off-by: Jyri Sarha <e4dfba208fcd45abd4fae1b9b3d55ae818ddca52@ti.com>

MWisBest/android_external_speex,MWisBest/android_external_speex