mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
Fixes error with frame datalen being calculated from samples when this is not allwaya accurate.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -71,7 +71,12 @@ static int resamp_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
|||||||
{
|
{
|
||||||
SpeexResamplerState *resamp_pvt = pvt->pvt;
|
SpeexResamplerState *resamp_pvt = pvt->pvt;
|
||||||
unsigned int out_samples = (OUTBUF_SIZE / sizeof(int16_t)) - pvt->samples;
|
unsigned int out_samples = (OUTBUF_SIZE / sizeof(int16_t)) - pvt->samples;
|
||||||
unsigned int in_samples = f->samples;
|
unsigned int in_samples;
|
||||||
|
|
||||||
|
if (!f->datalen) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
in_samples = f->datalen / 2;
|
||||||
|
|
||||||
speex_resampler_process_int(resamp_pvt,
|
speex_resampler_process_int(resamp_pvt,
|
||||||
0,
|
0,
|
||||||
|
Reference in New Issue
Block a user