[asterisk-commits] russell: branch russell/jack r94786 - /team/russell/jack/codecs/codec_resample.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Dec 26 10:12:28 CST 2007
Author: russell
Date: Wed Dec 26 10:12:28 2007
New Revision: 94786
URL: http://svn.digium.com/view/asterisk?view=rev&rev=94786
Log:
Use the correct starting point if there is still some data in the translator
buffer. Also, don't forget to update the number of samples and bytes in the
translator buffer after processing a frame.
Modified:
team/russell/jack/codecs/codec_resample.c
Modified: team/russell/jack/codecs/codec_resample.c
URL: http://svn.digium.com/view/asterisk/team/russell/jack/codecs/codec_resample.c?view=diff&rev=94786&r1=94785&r2=94786
==============================================================================
--- team/russell/jack/codecs/codec_resample.c (original)
+++ team/russell/jack/codecs/codec_resample.c Wed Dec 26 10:12:28 2007
@@ -100,7 +100,7 @@
int total_in_buf_used = 0;
int total_out_buf_used = 0;
int16_t *in_buf = (int16_t *) f->data;
- int16_t *out_buf = (int16_t *) pvt->outbuf;
+ int16_t *out_buf = (int16_t *) pvt->outbuf + pvt->samples;
float in_buf_f[f->samples];
float out_buf_f[2048];
int res = 0;
@@ -132,6 +132,9 @@
for (i = 0; i < total_out_buf_used; i++)
out_buf[i] = out_buf_f[i] * (SHRT_MAX / FLT_MAX);
+
+ pvt->samples += total_out_buf_used;
+ pvt->datalen += (total_out_buf_used * sizeof(int16_t));
return res;
}
More information about the asterisk-commits
mailing list