mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 11:06:31 +00:00
translate: generic plc not filled in after translation
If during translation a codec could not handle a given frame the translation core would return NULL, thus not passing along the "missing" frame. Due to this there was no frame to apply generic plc to, thus rendering it useless. This patch makes it so the translation core produces an interpolated slin frame in the cases where an attempt was made to translate to slin, but failed. This interpolated frame is then passed along and can be used by the generic plc algorithms to fill in the frame. ASTERISK-27814 #close Change-Id: I133d084da87adef913bf2ecc9c9240e3eaf4f40a
This commit is contained in:
@@ -54,6 +54,12 @@ static struct ast_frame *generic_read(struct ast_filestream *s, int *whennext, u
|
||||
static int slinear_write(struct ast_filestream *fs, struct ast_frame *f)
|
||||
{
|
||||
int res;
|
||||
|
||||
/* Don't try to write an interpolated frame */
|
||||
if (f->datalen == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((res = fwrite(f->data.ptr, 1, f->datalen, fs->f)) != f->datalen) {
|
||||
ast_log(LOG_WARNING, "Bad write (%d/%d): %s\n", res, f->datalen, strerror(errno));
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user