[svn-commits] russell: branch russell/g722-sillyness r106499 - /team/russell/g722-sillyness...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 6 18:06:26 CST 2008


Author: russell
Date: Thu Mar  6 18:06:25 2008
New Revision: 106499

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106499
Log:
Fix another bit of sillyness regarding g722 samples.  g722_decode() expects the
samples parameter to be the number of samples / 2 ... stupid incorrect specs that
people follow anyway ...

(issue #12130)

Modified:
    team/russell/g722-sillyness/codecs/codec_g722.c

Modified: team/russell/g722-sillyness/codecs/codec_g722.c
URL: http://svn.digium.com/view/asterisk/team/russell/g722-sillyness/codecs/codec_g722.c?view=diff&rev=106499&r1=106498&r2=106499
==============================================================================
--- team/russell/g722-sillyness/codecs/codec_g722.c (original)
+++ team/russell/g722-sillyness/codecs/codec_g722.c Thu Mar  6 18:06:25 2008
@@ -102,9 +102,13 @@
 {
 	struct g722_decoder_pvt *tmp = pvt->pvt;
 	int out_samples;
+	int in_samples;
+
+	/* g722_decode expects the samples to be in the invalid samples / 2 format */
+	in_samples = f->samples / 2;
 
 	out_samples = g722_decode(&tmp->g722, (int16_t *) &pvt->outbuf[pvt->samples * sizeof(int16_t)], 
-		(uint8_t *) f->data, f->samples);
+		(uint8_t *) f->data, in_samples);
 
 	pvt->samples += out_samples;
 




More information about the svn-commits mailing list