diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-12-18 17:44:18 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-12-18 17:44:18 +0000 |
commit | 02e21cb5f200e58948a85119e8ae0d000f27fa13 (patch) | |
tree | f9059e3dfbb59eb229dbb5a74408b841a6f51464 /include/asterisk/channel.h | |
parent | 381d49c9af9b2b26d40c8225c5ffee799d22bdc9 (diff) |
unbreak the macro used for incrementing the frame counters.
I don't know when the bug was introduced, but with the typical usage
c->fin = FRAMECOUNT_INC(c->fin)
the frame counters stay to 0.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r-- | include/asterisk/channel.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 87f5efea8..03613aadd 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -310,8 +310,21 @@ struct ast_channel_tech { struct ast_channel_spy_list; /*!< \todo Add explanation here */ struct ast_channel_whisper_buffer; /*!< \todo Add explanation here */ +/*! + * The high bit of the frame count is used as a debug marker, so + * increments of the counters must be done with care. + * Please use c->fin = FRAMECOUNT_INC(c->fin) and the same for c->fout. + */ #define DEBUGCHAN_FLAG 0x80000000 -#define FRAMECOUNT_INC(x) ( ((x) & DEBUGCHAN_FLAG) | ((x++) & ~DEBUGCHAN_FLAG) ) + +/* XXX not ideal to evaluate x twice... */ +#define FRAMECOUNT_INC(x) ( ((x) & DEBUGCHAN_FLAG) | (((x)+1) & ~DEBUGCHAN_FLAG) ) + +/*! + * The current value of the debug flags is stored in the two + * variables global_fin and global_fout (declared in main/channel.c) + */ +extern unsigned long global_fin, global_fout; enum ast_channel_adsicpe { AST_ADSI_UNKNOWN, |