提交 231fbe5e authored 作者: Brian West's avatar Brian West

correct please test

上级 d3e7c2a6
BASE=../../../.. BASE=../../../..
CELT=celt-0.7.1 CELT=celt-0.10.0
CELT_DIR=$(switch_srcdir)/libs/$(CELT) CELT_DIR=$(switch_srcdir)/libs/$(CELT)
CELT_BUILDDIR=$(switch_builddir)/libs/$(CELT) CELT_BUILDDIR=$(switch_builddir)/libs/$(CELT)
......
...@@ -54,7 +54,7 @@ static switch_status_t switch_celt_init(switch_codec_t *codec, switch_codec_flag ...@@ -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); 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; 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, ...@@ -111,7 +111,7 @@ static switch_status_t switch_celt_encode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; 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); (unsigned char *) encoded_data, context->bytes_per_packet);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
...@@ -130,7 +130,7 @@ static switch_status_t switch_celt_decode(switch_codec_t *codec, ...@@ -130,7 +130,7 @@ static switch_status_t switch_celt_decode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; 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; return SWITCH_STATUS_GENERR;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论