From 231fbe5e7ac693fd3d05fd0c65aecc2a98416580 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 5 Jan 2011 16:48:11 -0600 Subject: [PATCH] correct please test --- src/mod/codecs/mod_celt/Makefile | 2 +- src/mod/codecs/mod_celt/mod_celt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod/codecs/mod_celt/Makefile b/src/mod/codecs/mod_celt/Makefile index cdcc045bdb..2d2e27f04c 100644 --- a/src/mod/codecs/mod_celt/Makefile +++ b/src/mod/codecs/mod_celt/Makefile @@ -1,6 +1,6 @@ BASE=../../../.. -CELT=celt-0.7.1 +CELT=celt-0.10.0 CELT_DIR=$(switch_srcdir)/libs/$(CELT) CELT_BUILDDIR=$(switch_builddir)/libs/$(CELT) diff --git a/src/mod/codecs/mod_celt/mod_celt.c b/src/mod/codecs/mod_celt/mod_celt.c index d65e095fbf..37983f3683 100644 --- a/src/mod/codecs/mod_celt/mod_celt.c +++ b/src/mod/codecs/mod_celt/mod_celt.c @@ -54,7 +54,7 @@ static switch_status_t switch_celt_init(switch_codec_t *codec, switch_codec_flag } context->mode_object = celt_mode_create(codec->implementation->actual_samples_per_second, codec->implementation->samples_per_packet, NULL); - celt_mode_info(context->mode_object, CELT_GET_FRAME_SIZE, &context->frame_size); + context->bytes_per_packet = (codec->implementation->bits_per_second * context->frame_size / codec->implementation->actual_samples_per_second + 4) / 8; /* @@ -111,7 +111,7 @@ static switch_status_t switch_celt_encode(switch_codec_t *codec, return SWITCH_STATUS_FALSE; } - *encoded_data_len = (uint32_t) celt_encode(context->encoder_object, (void *) decoded_data, NULL, + *encoded_data_len = (uint32_t) celt_encode(context->encoder_object, (void *) decoded_data, codec->implementation->samples_per_packet, (unsigned char *) encoded_data, context->bytes_per_packet); return SWITCH_STATUS_SUCCESS; @@ -130,7 +130,7 @@ static switch_status_t switch_celt_decode(switch_codec_t *codec, return SWITCH_STATUS_FALSE; } - if (celt_decode(context->decoder_object, encoded_data, encoded_data_len, decoded_data)) { + if (celt_decode(context->decoder_object, encoded_data, encoded_data_len, decoded_data, codec->implementation->samples_per_packet)) { return SWITCH_STATUS_GENERR; }