提交 8046beba authored 作者: Brian West's avatar Brian West

fix bv codecs

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15564 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 56e05a08
...@@ -54,11 +54,11 @@ static switch_status_t switch_bv16_init(switch_codec_t *codec, switch_codec_flag ...@@ -54,11 +54,11 @@ static switch_status_t switch_bv16_init(switch_codec_t *codec, switch_codec_flag
} }
if (encoding) { if (encoding) {
bv16_encode_init(context->encoder_object); context->encoder_object = bv16_encode_init(NULL);
} }
if (decoding) { if (decoding) {
bv16_decode_init(context->decoder_object); context->decoder_object = bv16_decode_init(NULL);
} }
codec->private_info = context; codec->private_info = context;
...@@ -67,6 +67,16 @@ static switch_status_t switch_bv16_init(switch_codec_t *codec, switch_codec_flag ...@@ -67,6 +67,16 @@ static switch_status_t switch_bv16_init(switch_codec_t *codec, switch_codec_flag
static switch_status_t switch_bv16_destroy(switch_codec_t *codec) static switch_status_t switch_bv16_destroy(switch_codec_t *codec)
{ {
struct bv16_context *context = codec->private_info;
if (context->encoder_object) {
bv16_encode_free(context->encoder_object);
}
if (context->decoder_object) {
bv16_decode_free(context->decoder_object);
}
codec->private_info = NULL; codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -127,11 +137,11 @@ static switch_status_t switch_bv32_init(switch_codec_t *codec, switch_codec_flag ...@@ -127,11 +137,11 @@ static switch_status_t switch_bv32_init(switch_codec_t *codec, switch_codec_flag
} }
if (encoding) { if (encoding) {
bv32_encode_init(context->encoder_object); context->encoder_object = bv32_encode_init(NULL);
} }
if (decoding) { if (decoding) {
bv32_decode_init(context->decoder_object); context->decoder_object = bv32_decode_init(NULL);
} }
codec->private_info = context; codec->private_info = context;
...@@ -140,7 +150,19 @@ static switch_status_t switch_bv32_init(switch_codec_t *codec, switch_codec_flag ...@@ -140,7 +150,19 @@ static switch_status_t switch_bv32_init(switch_codec_t *codec, switch_codec_flag
static switch_status_t switch_bv32_destroy(switch_codec_t *codec) static switch_status_t switch_bv32_destroy(switch_codec_t *codec)
{ {
struct bv32_context *context = codec->private_info;
if (context->encoder_object) {
bv32_encode_free(context->encoder_object);
}
if (context->decoder_object) {
bv32_decode_free(context->decoder_object);
}
codec->private_info = NULL; codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论