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

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4223 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 48935403
......@@ -58,7 +58,6 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, char *pat
sndfile_context *context;
int mode = 0;
char *ext;
int ready = 0;
struct format_map *map = NULL;
if ((ext = strrchr(path, '.')) == 0) {
......@@ -101,17 +100,12 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, char *pat
}
sf_command (context->handle, SFC_FILE_TRUNCATE, &frames, sizeof (frames));
}
if (map) {
context->sfinfo.format |= map->format;
ready = 1;
}
} else {
ready = 0;
}
if (!ready) {
ready = 1;
if (!strcmp(ext, "r8") || !strcmp(ext, "raw")) {
context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
context->sfinfo.channels = 1;
......@@ -140,14 +134,6 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, char *pat
context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_ALAW;
context->sfinfo.channels = 1;
context->sfinfo.samplerate = 8000;
} else {
ready = 0;
}
}
if (!ready) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening File [%s] [%s]\n", path);
return SWITCH_STATUS_GENERR;
}
if ((mode & SFM_WRITE) && sf_format_check (&context->sfinfo) == 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论