]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
codec_dahdi: Fix output of "transcoder show" CLI command.
authorKinsey Moore <kmoore@digium.com>
Fri, 7 Dec 2012 21:58:21 +0000 (21:58 +0000)
committerKinsey Moore <kmoore@digium.com>
Fri, 7 Dec 2012 21:58:21 +0000 (21:58 +0000)
In r306010 "Asterisk media architecture conversion - no more format
bitfields", the logic for incrementing encoders and decoders when
opening transcoder channels was changed without making the corresponding
change when decrementing encoder / decoder channels.  The result being
that when a channel was destroyed, codec_dahdi couldn't properly tell if
it was an encoder or decoder, and the default case is to assume it was a
decoder.

This could result in negative numbers for decoders in use like in:
  VOIP6*CLI> transcoder show
  2/-2 encoders/decoders of 92 channels are in use.

(closes issue ASTERISK-19921)
Patch-by: Shaun Ruffell
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@377382 65c4cc65-6c06-0410-ace0-fbb531ad65f3

codecs/codec_dahdi.c

index ccd323ae6866f8cc6e8bbfaf689de7b30cf44c60..5fedc25cb0672046b570e7c066812fc6ec902039 100644 (file)
@@ -396,7 +396,7 @@ static void dahdi_destroy(struct ast_trans_pvt *pvt)
 {
        struct codec_dahdi_pvt *dahdip = pvt->pvt;
 
-       switch (dahdip->fmts.dstfmt) {
+       switch (ast_format_id_from_old_bitfield(dahdip->fmts.dstfmt)) {
        case AST_FORMAT_G729A:
        case AST_FORMAT_G723_1:
                ast_atomic_fetchadd_int(&channels.encoders, -1);