aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-22 16:29:54 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-22 16:29:54 +0000
commitc1210321e7aeb274076b14fc2f622edf442246fa (patch)
treebcbbf4eda53cdb8257bbc7add4616e01e31b1ae2 /channels/chan_oss.c
parent2d9ba021dd38039616c82a4e317f652abe246ba3 (diff)
- revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void Recently the ast_queue_hangup function got a new parameter, the hangupcause Feedback came in that this is no good and that instead a new function should be created. This I did. The hangupcause was stored in the seqno member of the ast_frame struct. This is not very elegant, and since there's already a data member that one should be used. Problem is, this member was a void *. Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone wants to store another type in there in the future. This commit is so massive, because all ast_frame.data uses have to be altered to ast_frame.data.data Thanks russellb and kpfleming for the feedback. (closes issue #12674) Reported by: mvanbaak git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117802 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_oss.c')
-rw-r--r--channels/chan_oss.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 6edbbb88c..268ff782f 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -679,13 +679,13 @@ static int oss_write(struct ast_channel *c, struct ast_frame *f)
int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst, f->data + src, l);
+ memcpy(o->oss_write_buf + o->oss_write_dst, f->data.ptr + src, l);
soundcard_writeframe(o, (short *) o->oss_write_buf);
src += l;
o->oss_write_dst = 0;
} else { /* copy residue */
l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst, f->data + src, l);
+ memcpy(o->oss_write_buf + o->oss_write_dst, f->data.ptr + src, l);
src += l; /* but really, we are done */
o->oss_write_dst += l;
}
@@ -724,10 +724,10 @@ static struct ast_frame *oss_read(struct ast_channel *c)
f->subclass = AST_FORMAT_SLINEAR;
f->samples = FRAME_SIZE;
f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
+ f->data.ptr = o->oss_read_buf + AST_FRIENDLY_OFFSET;
if (o->boost != BOOST_SCALE) { /* scale and clip values */
int i, x;
- int16_t *p = (int16_t *) f->data;
+ int16_t *p = (int16_t *) f->data.ptr;
for (i = 0; i < f->samples; i++) {
x = (p[i] * o->boost) / BOOST_SCALE;
if (x > 32767)
@@ -1012,7 +1012,7 @@ static char *console_sendtext(struct ast_cli_entry *e, int cmd, struct ast_cli_a
buf[i] = '\n';
f.frametype = AST_FRAME_TEXT;
f.subclass = 0;
- f.data = buf;
+ f.data.ptr = buf;
f.datalen = i + 1;
ast_queue_frame(o->owner, &f);
}
@@ -1040,7 +1040,7 @@ static char *console_hangup(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
}
o->hookstate = 0;
if (o->owner)
- ast_queue_hangup(o->owner, AST_CAUSE_NORMAL_CLEARING);
+ ast_queue_hangup_with_cause(o->owner, AST_CAUSE_NORMAL_CLEARING);
setformat(o, O_CLOSE);
return CLI_SUCCESS;
}