fix mod_native_file extension thingy

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4212 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-02-12 22:56:08 +00:00
parent 8e2c70d797
commit e360d6500c
3 changed files with 7 additions and 1 deletions

View File

@ -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)
</pre>
*/
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 {

View File

@ -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);

View File

@ -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;