.sample = ilbctolin_sample,
.desc_size = sizeof(struct ilbc_coder_pvt),
.buf_size = BUFFER_SAMPLES * 2,
+ .native_plc = 1,
};
static struct ast_translator lintoilbc = {
.desc_size = sizeof(struct speex_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
+ .native_plc = 1,
};
static struct ast_translator lintospeex = {
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 */
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");