提交 72f52aae authored 作者: Anthony Minessale's avatar Anthony Minessale

only all one file to be bound per instance

上级 5f18ec94
...@@ -325,24 +325,29 @@ static switch_bool_t ladspa_callback(switch_media_bug_t *bug, void *user_data, s ...@@ -325,24 +325,29 @@ static switch_bool_t ladspa_callback(switch_media_bug_t *bug, void *user_data, s
mapped = 1; mapped = 1;
} else if (!strncasecmp(pvt->str_config[str_idx], "file:", 5)) { } else if (!strncasecmp(pvt->str_config[str_idx], "file:", 5)) {
char *file = pvt->str_config[str_idx] + 5; char *file = pvt->str_config[str_idx] + 5;
if (switch_core_file_open(&pvt->fh, if (switch_test_flag((&pvt->fh), SWITCH_FILE_OPEN)) {
file, switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session),
read_impl.number_of_channels, SWITCH_LOG_ERROR, "CAN'T CONNECT FILE [%s] File already mapped\n", file);
read_impl.actual_samples_per_second, } else {
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) { if (switch_core_file_open(&pvt->fh,
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_ERROR, "Cannot open file: %s\n", file); file,
return SWITCH_FALSE; read_impl.number_of_channels,
} read_impl.actual_samples_per_second,
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_ERROR, "Cannot open file: %s\n", file);
return SWITCH_FALSE;
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "CONNECT FILE [%s] to port: %s\n", switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "CONNECT FILE [%s] to port: %s\n",
file, file,
pvt->ldesc->PortNames[i] pvt->ldesc->PortNames[i]
); );
pvt->ldesc->connect_port(pvt->handle, i, pvt->file_buf); pvt->ldesc->connect_port(pvt->handle, i, pvt->file_buf);
mapped = 1; mapped = 1;
}
} }
str_idx++; str_idx++;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论