mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Merge "frame: Better handle interpolated frames."
This commit is contained in:
@@ -945,6 +945,15 @@ static struct ast_frame *audio_audiohook_write_list(struct ast_channel *chan, st
|
||||
if (!(middle_frame = audiohook_list_translate_to_slin(audiohook_list, direction, start_frame))) {
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* If the translation resulted in an interpolated frame then immediately return as audiohooks
|
||||
* rely on actual media being present to do things.
|
||||
*/
|
||||
if (!middle_frame->data.ptr) {
|
||||
ast_frfree(middle_frame);
|
||||
return start_frame;
|
||||
}
|
||||
|
||||
samples = middle_frame->samples;
|
||||
|
||||
/*
|
||||
|
@@ -442,8 +442,14 @@ struct ast_frame *ast_trans_frameout(struct ast_trans_pvt *pvt,
|
||||
}
|
||||
if (datalen) {
|
||||
f->datalen = datalen;
|
||||
f->data.ptr = pvt->outbuf.c;
|
||||
} else {
|
||||
f->datalen = pvt->datalen;
|
||||
if (!f->datalen) {
|
||||
f->data.ptr = NULL;
|
||||
} else {
|
||||
f->data.ptr = pvt->outbuf.c;
|
||||
}
|
||||
pvt->datalen = 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user