提交 3e405577 authored 作者: Brian West's avatar Brian West

doh I did that wrong

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11156 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 ad60ae2a
...@@ -204,13 +204,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, ...@@ -204,13 +204,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh,
switch_resample_process(fh->resampler, fh->resampler->from, fh->resampler->from_len, fh->resampler->to, fh->resampler->to_size, 0); switch_resample_process(fh->resampler, fh->resampler->from, fh->resampler->from_len, fh->resampler->to, fh->resampler->to_size, 0);
if (fh->resampler->to_len < want || fh->resampler->to_len > orig_len) { if (fh->resampler->to_len < want || fh->resampler->to_len > orig_len) {
int factor = fh->resampler->to_len * fh->samplerate / 1000;
if (!fh->buffer) { if (!fh->buffer) {
int factor = fh->resampler->to_len * fh->samplerate / 1000;
switch_buffer_create_dynamic(&fh->buffer, factor, factor, 0); switch_buffer_create_dynamic(&fh->buffer, factor, factor, 0);
switch_assert(fh->buffer); switch_assert(fh->buffer);
} }
if (!fh->dbuf) { if (!fh->dbuf) {
fh->dbuflen = want * factor; fh->dbuflen = want * 4;
fh->dbuf = switch_core_alloc(fh->memory_pool, fh->dbuflen); fh->dbuf = switch_core_alloc(fh->memory_pool, fh->dbuflen);
} }
switch_assert(fh->resampler->to_len <= fh->dbuflen); switch_assert(fh->resampler->to_len <= fh->dbuflen);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论