From e360d6500cfcf04eb859ff7548af4c89e270bf8f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 12 Feb 2007 22:56:08 +0000 Subject: [PATCH] fix mod_native_file extension thingy git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4212 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_types.h | 4 +++- src/mod/formats/mod_native_file/mod_native_file.c | 1 + src/switch_ivr.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index adb5556dd1..25c0400f88 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -682,6 +682,7 @@ SWITCH_FILE_DATA_FLOAT = (1 << 5) - Read data in floats SWITCH_FILE_DATA_DOUBLE = (1 << 6) - Read data in doubles SWITCH_FILE_DATA_RAW = (1 << 7) - Read data as is SWITCH_FILE_PAUSE = (1 << 8) - Pause +SWITCH_FILE_NATIVE = (1 << 8) - File is in native format (no transcoding) */ typedef enum { @@ -693,7 +694,8 @@ typedef enum { SWITCH_FILE_DATA_FLOAT = (1 << 5), SWITCH_FILE_DATA_DOUBLE = (1 << 6), SWITCH_FILE_DATA_RAW = (1 << 7), - SWITCH_FILE_PAUSE = (1 << 8) + SWITCH_FILE_PAUSE = (1 << 8), + SWITCH_FILE_NATIVE = (1 << 9) } switch_file_flag_t; typedef enum { diff --git a/src/mod/formats/mod_native_file/mod_native_file.c b/src/mod/formats/mod_native_file/mod_native_file.c index 21ef5976ba..50b26bdc1e 100644 --- a/src/mod/formats/mod_native_file/mod_native_file.c +++ b/src/mod/formats/mod_native_file/mod_native_file.c @@ -78,6 +78,7 @@ static switch_status_t native_file_file_open(switch_file_handle_t *handle, char handle->seekable = 1; handle->speed = 0; handle->private_info = context; + handle->flags |= SWITCH_FILE_NATIVE; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening File [%s] %dhz\n", path, handle->samplerate); diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 3c764278d9..b367c740cb 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -1142,6 +1142,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess switch_core_session_reset(session); return SWITCH_STATUS_NOTFOUND; } + if (switch_test_flag(fh, SWITCH_FILE_NATIVE)) { + asis = 1; + } write_frame.data = abuf;