Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
Merged revisions 65877 via svnmerge from
Browse files Browse the repository at this point in the history
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r65877 | qwell | 2007-05-24 11:14:02 -0400 (Thu, 24 May 2007) | 4 lines

Fix handling of zero-length frames when a codec is capable of native PLC.

Issue 9183, patch by Mihai.

........


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@65903 f38db490-d61c-443f-a65b-d21fe96a405b
  • Loading branch information
Jason Parker committed May 24, 2007
1 parent 173ec77 commit 0be9da0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .cleancount
Original file line number Diff line number Diff line change
@@ -1 +1 @@
30
31
1 change: 1 addition & 0 deletions codecs/codec_ilbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ static struct ast_translator ilbctolin = {
.sample = ilbctolin_sample,
.desc_size = sizeof(struct ilbc_coder_pvt),
.buf_size = BUFFER_SAMPLES * 2,
.native_plc = 1,
};

static struct ast_translator lintoilbc = {
Expand Down
1 change: 1 addition & 0 deletions codecs/codec_speex.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ static struct ast_translator speextolin = {
.desc_size = sizeof(struct speex_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
.native_plc = 1,
};

static struct ast_translator lintospeex = {
Expand Down
1 change: 1 addition & 0 deletions include/asterisk/translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct ast_translator {
int desc_size; /*!< size of private descriptor in pvt->pvt, if any */
int plc_samples; /*!< set to the plc block size if used, 0 otherwise */
int useplc; /*!< current status of plc, changed at runtime */
int native_plc; /*!< true if the translator can do native plc */

struct ast_module *module; /* opaque reference to the parent module */

Expand Down
4 changes: 3 additions & 1 deletion main/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
pvt->samples += l;
pvt->datalen = pvt->samples * 2; /* SLIN has 2bytes for 1sample */
}
return 0;
/* We don't want generic PLC. If the codec has native PLC, then do that */
if (!pvt->t->native_plc)
return 0;
}
if (pvt->samples + f->samples > pvt->t->buffer_samples) {
ast_log(LOG_WARNING, "Out of buffer space\n");
Expand Down

0 comments on commit 0be9da0

Please sign in to comment.