mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Correctly set the total number of channels from a zaptel transcoder board.
SPD-49, patch by Matthew Nicholson. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -224,7 +224,6 @@ static void zap_destroy(struct ast_trans_pvt *pvt)
|
||||
if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
|
||||
ast_log(LOG_WARNING, "Failed to release transcoder channel: %s\n", strerror(errno));
|
||||
|
||||
ast_atomic_fetchadd_int(&channels.total, -1);
|
||||
switch (ztp->hdr->dstfmt) {
|
||||
case AST_FORMAT_G729A:
|
||||
case AST_FORMAT_G723_1:
|
||||
@@ -286,7 +285,6 @@ static int zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
|
||||
ztp->fd = fd;
|
||||
ztp->hdr = hdr;
|
||||
|
||||
ast_atomic_fetchadd_int(&channels.total, +1);
|
||||
switch (hdr->dstfmt) {
|
||||
case AST_FORMAT_G729A:
|
||||
case AST_FORMAT_G723_1:
|
||||
@@ -442,6 +440,7 @@ static int find_transcoders(void)
|
||||
if (option_verbose > 1)
|
||||
ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
|
||||
build_translators(&map, info.dstfmts, info.srcfmts);
|
||||
ast_atomic_fetchadd_int(&channels.total, info.numchannels / 2);
|
||||
}
|
||||
close(fd);
|
||||
|
||||
|
Reference in New Issue
Block a user