aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_resample.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-11 18:48:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-11 18:48:07 +0000
commitccce263b5c1da5d911a81a083669957ce6e9ac98 (patch)
treea2c90d61491939ff83913dabf1d38f0593a1c8fe /codecs/codec_resample.c
parent69d71a14dec4635647d6492725a1ae89269060fc (diff)
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: http://svn.digium.com/svn/asterisk/trunk@98270 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_resample.c')
-rw-r--r--codecs/codec_resample.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/codecs/codec_resample.c b/codecs/codec_resample.c
index 9be951c9c..871bbc3f3 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)