git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4600 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West
2007-03-15 01:58:41 +00:00
parent d35dda719e
commit ffde2ff0af
8 changed files with 42 additions and 16 deletions
@@ -1781,8 +1781,9 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th
}
if (switch_core_file_open(&fh,
NULL,
rec->path,
conference->rate,
1,
SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT,
rec->pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening File [%s]\n", rec->path);
@@ -1958,8 +1959,9 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char *
/* Open the file */
if (switch_core_file_open(&fnode->fh,
NULL,
file,
conference->rate,
1,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
pool) != SWITCH_STATUS_SUCCESS) {
switch_core_destroy_memory_pool(&pool);
@@ -2044,8 +2046,9 @@ static switch_status_t conference_member_play_file(conference_member_t *member,
/* Open the file */
if (switch_core_file_open(&fnode->fh,
switch_core_session_get_read_codec(member->session)->implementation,
file,
conference->rate,
1,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
pool) != SWITCH_STATUS_SUCCESS) {
switch_core_destroy_memory_pool(&pool);
+1
View File
@@ -1,5 +1,6 @@
# define these targets in your makefile if you wish
# local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
BASE=../../../..
OSARCH=$(shell uname -s)
# and define these variables to impact your build
MODNAME=mod_portaudio
@@ -225,8 +225,9 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_set_flag_locked((&globals), GFLAG_RING);
if (ring_file) {
if (switch_core_file_open(&fh,
globals.read_codec.implementation,
ring_file,
globals.read_codec.implementation->number_of_channels,
globals.read_codec.implementation->samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
NULL) == SWITCH_STATUS_SUCCESS) {
@@ -589,8 +590,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
}
if (switch_core_file_open(&tech_pvt->fh,
globals.read_codec.implementation,
tech_pvt->hold_file,
globals.read_codec.implementation->number_of_channels,
globals.read_codec.implementation->samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_core_codec_destroy(&tech_pvt->write_codec);
+5 -1
View File
@@ -440,8 +440,12 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, char *path)
return SWITCH_STATUS_MEMERR;
}
if (!handle->samplerate) {
handle->samplerate = 8000;
}
context->memory_pool = handle->memory_pool;
context->samplerate = handle->codec_imp ? handle->codec_imp->samples_per_second : 8000;
context->samplerate = handle->samplerate;
if (switch_test_flag(handle, SWITCH_FILE_FLAG_READ)) {
if (switch_buffer_create_dynamic(&context->audio_buffer, MY_BLOCK_SIZE, MY_BUF_LEN, 0) != SWITCH_STATUS_SUCCESS) {