提交 6231ceb0 authored 作者: Anthony Minessale's avatar Anthony Minessale

use individual pools in open file handles to avoid flooding the pool

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8302 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 cc88332e
...@@ -584,7 +584,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch ...@@ -584,7 +584,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
globals.read_codec.implementation->number_of_channels, globals.read_codec.implementation->number_of_channels,
globals.read_codec.implementation->actual_samples_per_second, globals.read_codec.implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) { NULL) != SWITCH_STATUS_SUCCESS) {
switch_core_codec_destroy(&tech_pvt->write_codec); switch_core_codec_destroy(&tech_pvt->write_codec);
tech_pvt->hold_file = NULL; tech_pvt->hold_file = NULL;
goto cng; goto cng;
......
...@@ -496,7 +496,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch ...@@ -496,7 +496,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
globals.read_codec.implementation->number_of_channels, globals.read_codec.implementation->number_of_channels,
globals.read_codec.implementation->actual_samples_per_second, globals.read_codec.implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) { NULL) != SWITCH_STATUS_SUCCESS) {
tech_pvt->hold_file = NULL; tech_pvt->hold_file = NULL;
goto cng; goto cng;
} }
......
...@@ -170,7 +170,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void ...@@ -170,7 +170,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
(char *)fname, (char *)fname,
source->channels, source->channels,
source->rate, source->rate,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, source->pool) != SWITCH_STATUS_SUCCESS) { SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open %s\n", fname); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open %s\n", fname);
switch_yield(1000000); switch_yield(1000000);
continue; continue;
......
...@@ -308,7 +308,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_ ...@@ -308,7 +308,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_
read_codec->implementation->number_of_channels, read_codec->implementation->number_of_channels,
read_codec->implementation->actual_samples_per_second, read_codec->implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { NULL) != SWITCH_STATUS_SUCCESS) {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE);
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
...@@ -755,7 +755,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t ...@@ -755,7 +755,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
file, file,
channels, channels,
read_codec->implementation->actual_samples_per_second, read_codec->implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", file); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", file);
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE);
......
...@@ -341,7 +341,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t ...@@ -341,7 +341,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t
read_codec->implementation->number_of_channels, read_codec->implementation->number_of_channels,
read_codec->implementation->actual_samples_per_second, read_codec->implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n");
switch_safe_free(tmp_data); switch_safe_free(tmp_data);
goto done; goto done;
...@@ -994,7 +994,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess ...@@ -994,7 +994,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
read_codec->implementation->number_of_channels, read_codec->implementation->number_of_channels,
read_codec->implementation->actual_samples_per_second, read_codec->implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n");
switch_safe_free(tmp_data); switch_safe_free(tmp_data);
goto notready; goto notready;
......
...@@ -373,7 +373,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se ...@@ -373,7 +373,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
file, file,
fh->channels, fh->channels,
read_codec->implementation->actual_samples_per_second, read_codec->implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE);
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
...@@ -789,7 +789,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess ...@@ -789,7 +789,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
file, file,
read_codec->implementation->number_of_channels, read_codec->implementation->number_of_channels,
read_codec->implementation->actual_samples_per_second, read_codec->implementation->actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
switch_core_session_reset(session, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE);
status = SWITCH_STATUS_NOTFOUND; status = SWITCH_STATUS_NOTFOUND;
goto end; goto end;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论