mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Fix chan_modem_i4l (bug #3410)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -420,7 +420,7 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
|
|||||||
if (!f)
|
if (!f)
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
*(b++) = AST_A2LIN(result[x]);
|
*(b++) = AST_ALAW(result[x]);
|
||||||
p->obuflen += 2;
|
p->obuflen += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,7 +480,7 @@ static int i4l_write(struct ast_modem_pvt *p, struct ast_frame *f)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (x=0;x<f->datalen/2;x++) {
|
for (x=0;x<f->datalen/2;x++) {
|
||||||
b = AST_ALAW(((short *)f->data)[x]);
|
b = AST_LIN2A(((short *)f->data)[x]);
|
||||||
result[bpos++] = b;
|
result[bpos++] = b;
|
||||||
if (b == CHAR_DLE)
|
if (b == CHAR_DLE)
|
||||||
result[bpos++]=b;
|
result[bpos++]=b;
|
||||||
|
@@ -29,6 +29,6 @@ extern unsigned char __ast_lin2a[8192];
|
|||||||
extern short __ast_alaw[256];
|
extern short __ast_alaw[256];
|
||||||
|
|
||||||
#define AST_LIN2A(a) (__ast_lin2a[((unsigned short)(a)) >> 3])
|
#define AST_LIN2A(a) (__ast_lin2a[((unsigned short)(a)) >> 3])
|
||||||
#define AST_ALAW(a) (__ast_alaw[(a)])
|
#define AST_ALAW(a) (__ast_alaw[(int)(a)])
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user