summaryrefslogtreecommitdiff
path: root/src/post/audio/stretch.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2007-08-16 16:29:26 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2007-08-16 16:29:26 +0100
commitd3e91bb09c694dc8a71b77f098ab251755763410 (patch)
tree1e2d82197a62813e8dd0b49e112e1b0f965fc5bd /src/post/audio/stretch.c
parentf43c0bf92a48824ed075473e9035d4c0dfe5cf33 (diff)
parent7047d9e5acf97c91a523c99ccc4b008a35a3e094 (diff)
downloadxine-lib-d3e91bb09c694dc8a71b77f098ab251755763410.tar.gz
xine-lib-d3e91bb09c694dc8a71b77f098ab251755763410.tar.bz2
Merge all but the open()/glibc workaround from 1.1.
Diffstat (limited to 'src/post/audio/stretch.c')
-rw-r--r--src/post/audio/stretch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c
index a1e921e03..054468517 100644
--- a/src/post/audio/stretch.c
+++ b/src/post/audio/stretch.c
@@ -225,6 +225,8 @@ struct post_plugin_stretch_s {
int frames_per_frag;
int frames_per_outfrag;
int num_frames; /* current # of frames on audiofrag */
+
+ int16_t last_sample[RESAMPLE_MAX_CHANNELS];
int64_t pts; /* pts for audiofrag */
@@ -353,12 +355,16 @@ static void stretch_process_fragment( post_audio_port_t *port,
if( !this->params.preserve_pitch ) {
if( this->channels == 2 )
- _x_audio_out_resample_stereo(this->audiofrag, num_frames_in,
+ _x_audio_out_resample_stereo(this->last_sample, this->audiofrag, num_frames_in,
this->outfrag, num_frames_out);
else if( this->channels == 1 )
- _x_audio_out_resample_mono(this->audiofrag, num_frames_in,
+ _x_audio_out_resample_mono(this->last_sample, this->audiofrag, num_frames_in,
this->outfrag, num_frames_out);
} else {
+ if (this->channels == 2)
+ memcpy (this->last_sample, &this->audiofrag[(num_frames_in - 1) * 2], 2 * sizeof (this->last_sample[0]));
+ else if (this->channels == 1)
+ memcpy (this->last_sample, &this->audiofrag[num_frames_in - 1], sizeof (this->last_sample[0]));
if( num_frames_in > num_frames_out )
{
/*