mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 00:24:05 +00:00
Merge "frame: Better handle interpolated frames." into 13
This commit is contained in:
@@ -942,6 +942,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))) {
|
if (!(middle_frame = audiohook_list_translate_to_slin(audiohook_list, direction, start_frame))) {
|
||||||
return 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;
|
samples = middle_frame->samples;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -444,8 +444,14 @@ struct ast_frame *ast_trans_frameout(struct ast_trans_pvt *pvt,
|
|||||||
}
|
}
|
||||||
if (datalen) {
|
if (datalen) {
|
||||||
f->datalen = datalen;
|
f->datalen = datalen;
|
||||||
|
f->data.ptr = pvt->outbuf.c;
|
||||||
} else {
|
} else {
|
||||||
f->datalen = pvt->datalen;
|
f->datalen = pvt->datalen;
|
||||||
|
if (!f->datalen) {
|
||||||
|
f->data.ptr = NULL;
|
||||||
|
} else {
|
||||||
|
f->data.ptr = pvt->outbuf.c;
|
||||||
|
}
|
||||||
pvt->datalen = 0;
|
pvt->datalen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user