[asterisk-commits] russell: trunk r98270 - /trunk/codecs/codec_resample.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 11 12:48:07 CST 2008


Author: russell
Date: Fri Jan 11 12:48:07 2008
New Revision: 98270

URL: http://svn.digium.com/view/asterisk?view=rev&rev=98270
Log:
Fix a bus error that happened when asterisk was built with optimizations on 
with platforms that explode on unaligned access.  I'm not exactly sure why
this fixes it, but it fixed it on the machine I was testing on.  If it makes
sense to you, feel free to enlighten me.  :)

(closes issue #11725, patched by me)

Modified:
    trunk/codecs/codec_resample.c

Modified: trunk/codecs/codec_resample.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/codec_resample.c?view=diff&rev=98270&r1=98269&r2=98270
==============================================================================
--- trunk/codecs/codec_resample.c (original)
+++ trunk/codecs/codec_resample.c Fri Jan 11 12:48:07 2008
@@ -145,15 +145,19 @@
 static int slin16_to_slin8_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
 {
 	struct slin16_to_slin8_pvt *resamp_pvt = pvt->pvt;
-
-	return resample_frame(pvt, resamp_pvt->resampler, resamp_pvt->resample_factor, f);
+	void *resampler = resamp_pvt->resampler;
+	float resample_factor = resamp_pvt->resample_factor;
+
+	return resample_frame(pvt, resampler, resample_factor, f);
 }
 
 static int slin8_to_slin16_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
 {
 	struct slin8_to_slin16_pvt *resamp_pvt = pvt->pvt;
-
-	return resample_frame(pvt, resamp_pvt->resampler, resamp_pvt->resample_factor, f);
+	void *resampler = resamp_pvt->resampler;
+	float resample_factor = resamp_pvt->resample_factor;
+
+	return resample_frame(pvt, resampler, resample_factor, f);
 }
 
 static struct ast_frame *slin16_to_slin8_sample(void)




More information about the asterisk-commits mailing list