diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2007-11-26 08:43:25 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2007-11-26 08:43:25 +0000 |
commit | d222cb6c1456a48b90b2887ba8f5f2e9358bc79d (patch) | |
tree | e170a45e371b56416384cb41f3b19270e434482b /gst/speexresample/gstspeexresample.c | |
parent | 67d4bcd555dcab6ce38481deecc1c0179915d268 (diff) | |
download | gst-plugins-bad-d222cb6c1456a48b90b2887ba8f5f2e9358bc79d.tar.gz gst-plugins-bad-d222cb6c1456a48b90b2887ba8f5f2e9358bc79d.tar.bz2 gst-plugins-bad-d222cb6c1456a48b90b2887ba8f5f2e9358bc79d.zip |
gst/speexresample/: Update speex resampler to latest SVN. We're now down to only the changes noted in README again.
Original commit message from CVS:
* gst/speexresample/README:
* gst/speexresample/arch.h:
* gst/speexresample/resample.c: (resampler_basic_direct_single),
(resampler_basic_direct_double),
(resampler_basic_interpolate_single),
(resampler_basic_interpolate_double),
(speex_resampler_process_native), (speex_resampler_process_float),
(speex_resampler_process_int),
(speex_resampler_process_interleaved_float),
(speex_resampler_process_interleaved_int),
(speex_resampler_get_input_latency),
(speex_resampler_get_output_latency):
* gst/speexresample/speex_resampler.h:
Update speex resampler to latest SVN. We're now down to only the
changes noted in README again.
* gst/speexresample/speex_resampler_wrapper.h:
* gst/speexresample/gstspeexresample.c:
(gst_speex_resample_push_drain), (gst_speex_resample_query):
Adjust to API changes.
Diffstat (limited to 'gst/speexresample/gstspeexresample.c')
-rw-r--r-- | gst/speexresample/gstspeexresample.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/gst/speexresample/gstspeexresample.c b/gst/speexresample/gstspeexresample.c index 95ded0d7..e6765a0f 100644 --- a/gst/speexresample/gstspeexresample.c +++ b/gst/speexresample/gstspeexresample.c @@ -524,7 +524,7 @@ gst_speex_resample_push_drain (GstSpeexResample * resample) resample_float_resampler_get_ratio (resample->state, &num, &den); - out_len = resample_float_resampler_get_latency (resample->state); + out_len = resample_float_resampler_get_input_latency (resample->state); out_len = out_processed = (out_len * den + (num >> 1)) / num; outsize = 4 * out_len * resample->channels; } else { @@ -532,7 +532,7 @@ gst_speex_resample_push_drain (GstSpeexResample * resample) resample_int_resampler_get_ratio (resample->state, &num, &den); - out_len = resample_int_resampler_get_latency (resample->state); + out_len = resample_int_resampler_get_input_latency (resample->state); out_len = out_processed = (out_len * den + (num >> 1)) / num; outsize = 2 * out_len * resample->channels; } @@ -545,12 +545,19 @@ gst_speex_resample_push_drain (GstSpeexResample * resample) return; } - if (resample->fp) - err = resample_float_resampler_drain_interleaved_float (resample->state, - (gfloat *) GST_BUFFER_DATA (buf), &out_processed); - else - err = resample_int_resampler_drain_interleaved_int (resample->state, - (gint16 *) GST_BUFFER_DATA (buf), &out_processed); + if (resample->fp) { + guint len = resample_float_resampler_get_input_latency (resample->state); + + err = + resample_float_resampler_process_interleaved_float (resample->state, + NULL, &len, (gfloat *) GST_BUFFER_DATA (buf), &out_processed); + } else { + guint len = resample_int_resampler_get_input_latency (resample->state); + + err = + resample_int_resampler_process_interleaved_int (resample->state, NULL, + &len, (gint16 *) GST_BUFFER_DATA (buf), &out_processed); + } if (err != RESAMPLER_ERR_SUCCESS) { GST_WARNING ("Failed to process drain: %s", @@ -866,10 +873,10 @@ gst_speex_resample_query (GstPad * pad, GstQuery * query) if (resample->state && resample->fp) resampler_latency = - resample_float_resampler_get_latency (resample->state); + resample_float_resampler_get_input_latency (resample->state); else if (resample->state && !resample->fp) resampler_latency = - resample_int_resampler_get_latency (resample->state); + resample_int_resampler_get_input_latency (resample->state); else resampler_latency = 0; |