提交 b4e75a27 authored 作者: Anthony Minessale's avatar Anthony Minessale

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@104 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 e59b65ef
......@@ -178,10 +178,13 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
}
if (implementation) {
switch_status status;
codec->codec_interface = codec_interface;
codec->implementation = implementation;
codec->flags = flags;
switch_core_new_memory_pool(&codec->memory_pool);
if ((status = switch_core_new_memory_pool(&codec->memory_pool)) != SWITCH_STATUS_SUCCESS) {
return status;
}
implementation->init(codec, flags, codec_settings);
return SWITCH_STATUS_SUCCESS;
......@@ -258,7 +261,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples)
{
switch_timer_interface *timer_interface;
switch_status status;
memset(timer, 0, sizeof(*timer));
if (!(timer_interface = loadable_module_get_timer_interface(timer_name))) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "invalid timer %s!\n", timer_name);
......@@ -269,7 +272,9 @@ SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *
timer->samples = samples;
timer->samplecount = 0;
timer->timer_interface = timer_interface;
switch_core_new_memory_pool(&timer->memory_pool);
if ((status = switch_core_new_memory_pool(&timer->memory_pool)) != SWITCH_STATUS_SUCCESS) {
return status;
}
timer->timer_interface->timer_init(timer);
return SWITCH_STATUS_SUCCESS;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论