report the same message whether Zaptel does not have transcoder support loaded or no transcoders were found

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2008-01-09 17:21:14 +00:00
parent 863ef8d7d2
commit ce81b232e3

View File

@@ -445,17 +445,19 @@ static int find_transcoders(void)
int fd, res; int fd, res;
unsigned int x, y; unsigned int x, y;
info.op = ZT_TCOP_GETINFO;
if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0) { if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0) {
ast_log(LOG_DEBUG, "No Zaptel transcoder support!\n"); ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n");
return 0; return 0;
} }
info.op = ZT_TCOP_GETINFO;
for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) { for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
if (option_verbose > 1) if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name); ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
build_translators(&map, info.dstfmts, info.srcfmts); build_translators(&map, info.dstfmts, info.srcfmts);
ast_atomic_fetchadd_int(&channels.total, info.numchannels / 2); ast_atomic_fetchadd_int(&channels.total, info.numchannels / 2);
} }
close(fd); close(fd);
if (!info.tcnum && (option_verbose > 1)) if (!info.tcnum && (option_verbose > 1))