mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
Convert casts to unions, to fix alignment issues on Solaris
(closes issue #12932) Reported by: snuffy Patches: bug_12932_20080627.diff uploaded by snuffy (license 35) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -230,7 +230,7 @@ static int adpcmtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
||||
struct adpcm_decoder_pvt *tmp = pvt->pvt;
|
||||
int x = f->datalen;
|
||||
unsigned char *src = f->data.ptr;
|
||||
int16_t *dst = (int16_t *)pvt->outbuf + pvt->samples;
|
||||
int16_t *dst = pvt->outbuf.i16 + pvt->samples;
|
||||
|
||||
while (x--) {
|
||||
*dst++ = decode((*src >> 4) & 0xf, &tmp->state);
|
||||
@@ -265,7 +265,7 @@ static struct ast_frame *lintoadpcm_frameout(struct ast_trans_pvt *pvt)
|
||||
pvt->samples &= ~1; /* atomic size is 2 samples */
|
||||
|
||||
for (i = 0; i < pvt->samples; i += 2) {
|
||||
pvt->outbuf[i/2] =
|
||||
pvt->outbuf.c[i/2] =
|
||||
(adpcm(tmp->inbuf[i ], &tmp->state) << 4) |
|
||||
(adpcm(tmp->inbuf[i+1], &tmp->state) );
|
||||
};
|
||||
|
Reference in New Issue
Block a user