From 2fd7f0b6bbdbb1d7eaa008e28adc854d19074f78 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 22 Jan 2009 00:18:00 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11348 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_core_file.c b/src/switch_core_file.c index 852f352842..02cf503538 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -221,8 +221,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, switch_buffer_create_dynamic(&fh->buffer, factor, factor, 0); switch_assert(fh->buffer); } - if (!fh->dbuf) { - fh->dbuflen = want * 8; + if (!fh->dbuf || fh->dbuflen < fh->resampler->to_len * 2) { + fh->dbuflen = fh->resampler->to_len * 2; fh->dbuf = switch_core_alloc(fh->memory_pool, fh->dbuflen); } switch_assert(fh->resampler->to_len <= fh->dbuflen);