From dad1eb7c83270f4aeec4af1514c2c71dc725b0d8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 30 Dec 2005 17:41:44 +0000 Subject: [PATCH] fix git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@247 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/mod_rawaudio/mod_rawaudio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mod/mod_rawaudio/mod_rawaudio.c b/src/mod/mod_rawaudio/mod_rawaudio.c index 3097619462..72b1af4b12 100644 --- a/src/mod/mod_rawaudio/mod_rawaudio.c +++ b/src/mod/mod_rawaudio/mod_rawaudio.c @@ -134,12 +134,12 @@ static switch_status switch_raw_encode(switch_codec *codec, return SWITCH_STATUS_MEMERR; } - context->enc->from = codec->implementation->samples_per_second; - context->enc->to = other_codec->implementation->samples_per_second; - context->enc->factor = ((double)context->enc->from / (double)context->enc->to); + context->enc->from = other_codec->implementation->samples_per_second; + context->enc->to = codec->implementation->samples_per_second; + context->enc->factor = ((double)context->enc->to / (double)context->enc->from); context->enc->resampler = resample_open(QUALITY, context->enc->factor, context->enc->factor); - switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Activate Encode Resample %d->%d %f\n", other_codec->implementation->samples_per_second, codec->implementation->samples_per_second, context->enc->factor); + switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Activate Encode Resample %d->%d %f\n", context->enc->from, context->enc->to, context->enc->factor); context->enc->buf_size = codec->implementation->bytes_per_frame * 10; context->enc->buf = (float *) switch_core_alloc(codec->memory_pool, context->enc->buf_size); context->enc->new_buf_size = codec->implementation->bytes_per_frame * 10; @@ -195,12 +195,12 @@ static switch_status switch_raw_decode(switch_codec *codec, } - context->dec->from = codec->implementation->samples_per_second; - context->dec->to = other_codec->implementation->samples_per_second; + context->dec->from = other_codec->implementation->samples_per_second; + context->dec->to = codec->implementation->samples_per_second; context->dec->factor = ((double)context->dec->from / (double)context->dec->to); context->dec->resampler = resample_open(QUALITY, context->dec->factor, context->dec->factor); - switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Activate Decode Resample %d->%d %f\n", other_codec->implementation->samples_per_second, codec->implementation->samples_per_second, context->dec->factor); + switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Activate Decode Resample %d->%d %f\n", context->dec->from, context->dec->to, context->dec->factor); context->dec->buf_size = codec->implementation->bytes_per_frame * 10; context->dec->buf = (float *) switch_core_alloc(codec->memory_pool, context->dec->buf_size);