[asterisk-commits] dvossel: branch dvossel/opus_codec_ftw r329893 - /team/dvossel/opus_codec_ftw...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 27 17:33:48 CDT 2011


Author: dvossel
Date: Wed Jul 27 17:33:44 2011
New Revision: 329893

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=329893
Log:
Fixes errors found during opus translation testing

Modified:
    team/dvossel/opus_codec_ftw/codecs/codec_opus.c

Modified: team/dvossel/opus_codec_ftw/codecs/codec_opus.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/opus_codec_ftw/codecs/codec_opus.c?view=diff&rev=329893&r1=329892&r2=329893
==============================================================================
--- team/dvossel/opus_codec_ftw/codecs/codec_opus.c (original)
+++ team/dvossel/opus_codec_ftw/codecs/codec_opus.c Wed Jul 27 17:33:44 2011
@@ -215,7 +215,6 @@
 	slin_data = enc->slin_buf;
 	opus_data = (unsigned char *) pvt->outbuf.c;
 
-	ast_log(LOG_NOTICE, "SLIN SAMPLES: %d  NEEDED SAMPLES %d\n", enc->slin_samples, enc->frame_size);
 
 	for ( ; enc->slin_samples >= enc->frame_size; enc->slin_samples -= enc->frame_size) {
 		num_bytes = opus_encode(enc->enc, slin_data, enc->frame_size, opus_data, enc->frame_offsets_numbytes);
@@ -292,8 +291,8 @@
 		opus_dec_set(pvt, &f->subclass.format);
 	}
 
-	error = opus_decode(dec->dec, f->data.ptr, f->datalen, dec->slin_buf, dec->frame_size, 1);
-	if (error) {
+	error = opus_decode(dec->dec, f->data.ptr, f->datalen, dec->slin_buf, dec->frame_size, 0);
+	if (error <= 0) {
 		ast_log(LOG_WARNING, "error decoding OPUS, error code %d\n", error);
 		return -1;
 	}
@@ -303,7 +302,6 @@
 
 	return 0;
 }
-
 
 static struct ast_frame *opus_dec_frameout(struct ast_trans_pvt *pvt)
 {
@@ -337,11 +335,10 @@
 	tmp.samples = samples;
 	tmp.src = pvt->t->name;
 	tmp.offset = AST_FRIENDLY_OFFSET;
-
 	pvt->samples = 0;
+
 	return ast_frdup(&tmp);
 }
-
 
 static int unload_module(void)
 {




More information about the asterisk-commits mailing list