mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
forgot some code from the last chanspy repass (nothing exciting)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -313,6 +313,20 @@ static int spy_generate(struct ast_channel *chan, void *data, int len, int sampl
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (csth->len0 < f0->datalen) {
|
||||
if (!csth->len0) {
|
||||
if (!(csth->buf0 = malloc(f0->datalen * 2))) {
|
||||
csth->spy.status = CHANSPY_DONE;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (!realloc(csth->buf0, f0->datalen * 2)) {
|
||||
csth->spy.status = CHANSPY_DONE;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
csth->len0 = f0->datalen;
|
||||
}
|
||||
memcpy(csth->buf0, f0->data, f0->datalen);
|
||||
maxsamp = f0->samples;
|
||||
}
|
||||
@@ -323,12 +337,12 @@ static int spy_generate(struct ast_channel *chan, void *data, int len, int sampl
|
||||
if ((f = ast_translate(csth->trans1, f1, 0))) {
|
||||
if (csth->len1 < f->datalen) {
|
||||
if (!csth->len1) {
|
||||
if (!(csth->buf1 = malloc(f->datalen))) {
|
||||
if (!(csth->buf1 = malloc(f->datalen * 2))) {
|
||||
csth->spy.status = CHANSPY_DONE;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (!realloc(csth->buf1, f->datalen)) {
|
||||
if (!realloc(csth->buf1, f->datalen * 2)) {
|
||||
csth->spy.status = CHANSPY_DONE;
|
||||
return -1;
|
||||
}
|
||||
@@ -345,6 +359,20 @@ static int spy_generate(struct ast_channel *chan, void *data, int len, int sampl
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (csth->len1 < f1->datalen) {
|
||||
if (!csth->len1) {
|
||||
if (!(csth->buf1 = malloc(f1->datalen * 2))) {
|
||||
csth->spy.status = CHANSPY_DONE;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (!realloc(csth->buf1, f1->datalen * 2)) {
|
||||
csth->spy.status = CHANSPY_DONE;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
csth->len1 = f1->datalen;
|
||||
}
|
||||
memcpy(csth->buf1, f1->data, f1->datalen);
|
||||
if (f1->samples > maxsamp) {
|
||||
maxsamp = f1->samples;
|
||||
|
Reference in New Issue
Block a user