From: Russell Bryant Date: Fri, 11 Jan 2008 18:48:07 +0000 (+0000) Subject: Fix a bus error that happened when asterisk was built with optimizations on X-Git-Tag: 1.6.0-beta1~3^2~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1256bb8a695b1bce14c47ad68011ab4c64522b4;p=thirdparty%2Fasterisk.git 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98270 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/codecs/codec_resample.c b/codecs/codec_resample.c index 9be951c9c6..871bbc3f3f 100644 --- a/codecs/codec_resample.c +++ b/codecs/codec_resample.c @@ -145,15 +145,19 @@ static int resample_frame(struct ast_trans_pvt *pvt, static int slin16_to_slin8_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) { struct slin16_to_slin8_pvt *resamp_pvt = pvt->pvt; + void *resampler = resamp_pvt->resampler; + float resample_factor = resamp_pvt->resample_factor; - return resample_frame(pvt, resamp_pvt->resampler, resamp_pvt->resample_factor, f); + 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; + void *resampler = resamp_pvt->resampler; + float resample_factor = resamp_pvt->resample_factor; - return resample_frame(pvt, resamp_pvt->resampler, resamp_pvt->resample_factor, f); + return resample_frame(pvt, resampler, resample_factor, f); } static struct ast_frame *slin16_to_slin8_sample(void)