[svn-commits] qwell: trunk r117828 - in /trunk: apps/ codecs/ formats/ funcs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 22 12:11:16 CDT 2008


Author: qwell
Date: Thu May 22 12:10:53 2008
New Revision: 117828

URL: http://svn.digium.com/view/asterisk?view=rev&rev=117828
Log:
Fix a few places where frame data was used directly.

Modified:
    trunk/apps/app_jack.c
    trunk/codecs/codec_speex.c
    trunk/formats/format_ogg_vorbis.c
    trunk/funcs/func_speex.c

Modified: trunk/apps/app_jack.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_jack.c?view=diff&rev=117828&r1=117827&r2=117828
==============================================================================
--- trunk/apps/app_jack.c (original)
+++ trunk/apps/app_jack.c Thu May 22 12:10:53 2008
@@ -484,7 +484,7 @@
 	float f_buf[f->samples * 8];
 	size_t f_buf_used = 0;
 	int i;
-	int16_t *s_buf = f->data;
+	int16_t *s_buf = f->data.ptr;
 	size_t res;
 
 	memset(f_buf, 0, sizeof(f_buf));
@@ -572,7 +572,7 @@
 		.frametype = AST_FRAME_VOICE,
 		.subclass = AST_FORMAT_SLINEAR,
 		.src = "JACK",
-		.data = buf,
+		.data.ptr = buf,
 		.datalen = sizeof(buf),
 		.samples = ARRAY_LEN(buf),
 	};
@@ -582,7 +582,7 @@
 		char *read_buf;
 
 		read_len = out_frame ? out_frame->datalen : sizeof(buf);
-		read_buf = out_frame ? out_frame->data : buf;
+		read_buf = out_frame ? out_frame->data.ptr : buf;
 
 		res = jack_ringbuffer_read_space(jack_data->input_rb);
 
@@ -590,7 +590,7 @@
 			/* Not enough data ready for another frame, move on ... */
 			if (out_frame) {
 				ast_debug(1, "Sending an empty frame for the JACK_HOOK\n");
-				memset(out_frame->data, 0, out_frame->datalen);
+				memset(out_frame->data.ptr, 0, out_frame->datalen);
 			}
 			break;
 		}

Modified: trunk/codecs/codec_speex.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/codec_speex.c?view=diff&rev=117828&r1=117827&r2=117828
==============================================================================
--- trunk/codecs/codec_speex.c (original)
+++ trunk/codecs/codec_speex.c Thu May 22 12:10:53 2008
@@ -165,7 +165,7 @@
 	f.mallocd = 0;
 	f.offset = 0;
 	f.src = __PRETTY_FUNCTION__;
-	f.data = slin_speex_ex;
+	f.data.ptr = slin_speex_ex;
 	return &f;
 }
 
@@ -180,7 +180,7 @@
 	f.mallocd = 0;
 	f.offset = 0;
 	f.src = __PRETTY_FUNCTION__;
-	f.data = speex_slin_ex;
+	f.data.ptr = speex_slin_ex;
 	return &f;
 }
 
@@ -220,7 +220,7 @@
 	}
 
 	/* Read in bits */
-	speex_bits_read_from(&tmp->bits, f->data, f->datalen);
+	speex_bits_read_from(&tmp->bits, f->data.ptr, f->datalen);
 	for (;;) {
 #ifdef _SPEEX_TYPES_H
 		res = speex_decode_int(tmp->speex, &tmp->bits, fout);
@@ -249,7 +249,7 @@
 	/* XXX We should look at how old the rest of our stream is, and if it
 	   is too old, then we should overwrite it entirely, otherwise we can
 	   get artifacts of earlier talk that do not belong */
-	memcpy(tmp->buf + pvt->samples, f->data, f->datalen);
+	memcpy(tmp->buf + pvt->samples, f->data.ptr, f->datalen);
 	pvt->samples += f->samples;
 	return 0;
 }

Modified: trunk/formats/format_ogg_vorbis.c
URL: http://svn.digium.com/view/asterisk/trunk/formats/format_ogg_vorbis.c?view=diff&rev=117828&r1=117827&r2=117828
==============================================================================
--- trunk/formats/format_ogg_vorbis.c (original)
+++ trunk/formats/format_ogg_vorbis.c Thu May 22 12:10:53 2008
@@ -291,7 +291,7 @@
 	if (!f->datalen)
 		return -1;
 
-	data = (short *) f->data;
+	data = (short *) f->data.ptr;
 
 	buffer = vorbis_analysis_buffer(&s->vd, f->samples);
 
@@ -433,7 +433,7 @@
 	fs->fr.subclass = AST_FORMAT_SLINEAR;
 	fs->fr.mallocd = 0;
 	AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE);
-	buf = (short *)(fs->fr.data);	/* SLIN data buffer */
+	buf = (short *)(fs->fr.data.ptr);	/* SLIN data buffer */
 
 	while (samples_out != SAMPLES_MAX) {
 		float **pcm;

Modified: trunk/funcs/func_speex.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_speex.c?view=diff&rev=117828&r1=117827&r2=117828
==============================================================================
--- trunk/funcs/func_speex.c (original)
+++ trunk/funcs/func_speex.c Thu May 22 12:10:53 2008
@@ -135,7 +135,7 @@
 		speex_preprocess_ctl(sdi->state, SPEEX_PREPROCESS_SET_DENOISE, &sdi->denoise);
 	}
 
-	speex_preprocess(sdi->state, frame->data, NULL);
+	speex_preprocess(sdi->state, frame->data.ptr, NULL);
 
 	return 0;
 }




More information about the svn-commits mailing list