diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-08-15 13:42:38 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2007-08-15 13:42:38 +0100 |
commit | 7047d9e5acf97c91a523c99ccc4b008a35a3e094 (patch) | |
tree | 80a7a22b47640a7b97f4f027797abf2d704d07e5 /src/xine-engine/resample.h | |
parent | 27aeb069aa930c0c8fa0e0f41885bbedc69d0bcb (diff) | |
download | xine-lib-7047d9e5acf97c91a523c99ccc4b008a35a3e094.tar.gz xine-lib-7047d9e5acf97c91a523c99ccc4b008a35a3e094.tar.bz2 |
Fix an audio resampling problem which was causing regular clicking.
The cause was that the resampling code was using only the samples in the buffer
but not really handling the transition between two buffers (which it would
handle completely independently). The new code remembers the last sample from
the previous buffer and uses it in the resampling. We therefore end up one
sample behind and without the clicks.
Diffstat (limited to 'src/xine-engine/resample.h')
-rw-r--r-- | src/xine-engine/resample.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/xine-engine/resample.h b/src/xine-engine/resample.h index e5aad1afa..1fd478d06 100644 --- a/src/xine-engine/resample.h +++ b/src/xine-engine/resample.h @@ -27,19 +27,26 @@ #ifndef HAVE_RESAMPLE_H #define HAVE_RESAMPLE_H -void _x_audio_out_resample_stereo(int16_t* input_samples, uint32_t in_samples, +#define RESAMPLE_MAX_CHANNELS 6 + +void _x_audio_out_resample_stereo(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; -void _x_audio_out_resample_mono(int16_t* input_samples, uint32_t in_samples, +void _x_audio_out_resample_mono(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; -void _x_audio_out_resample_4channel(int16_t* input_samples, uint32_t in_samples, +void _x_audio_out_resample_4channel(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; -void _x_audio_out_resample_5channel(int16_t* input_samples, uint32_t in_samples, +void _x_audio_out_resample_5channel(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; -void _x_audio_out_resample_6channel(int16_t* input_samples, uint32_t in_samples, +void _x_audio_out_resample_6channel(int16_t* last_sample, + int16_t* input_samples, uint32_t in_samples, int16_t* output_samples, uint32_t out_samples) XINE_PROTECTED; void _x_audio_out_resample_8to16(int8_t* input_samples, |