Review Board 1.7.16


Use the proper type for ast_codec_pref's framing field so that packetization values > 127 can be used

Review Request #1639 - Created Dec. 21, 2011 and submitted

Terry Wilson
1.8
ASTERISK-18876
Reviewers
asterisk-dev
Asterisk
ast_codec_pref has a framing field that is set as a signed char array even though every place in the code treats it as an int array. This just changes the field to an int array. It uses a magic number, but it is essentially the same thing that was there before. We could probably move the AST_FORMAT_LIST into the header and use its ARRAY_LEN as the size so that things are no bigger than they need to be. I figured I'd go with the smallest change first and see what people thought.
Made calls with allow=g729:230 and saw that it was used whereas before it looped around to a lower value.

Diff revision 1 (Latest)

  1. /branches/1.8/include/asterisk/frame.h: Loading...
/branches/1.8/include/asterisk/frame.h
Revision 348793 New Change
[20] 34 lines
[+20] [+] extern "C" {
35
#include "asterisk/endian.h"
35
#include "asterisk/endian.h"
36
#include "asterisk/linkedlists.h"
36
#include "asterisk/linkedlists.h"
37

    
   
37

   
38
struct ast_codec_pref {
38
struct ast_codec_pref {
39
	char order[sizeof(format_t) * 8];
39
	char order[sizeof(format_t) * 8];
40
	char framing[sizeof(format_t) * 8];
40
	int framing[64]; /*!< Magic numbers are bad, but this just needs to be bigger than ARRAY_LEN(AST_FORMAT_LIST) */
41
};
41
};
42

    
   
42

   
43
/*!
43
/*!
44
 * \page Def_Frame AST Multimedia and signalling frames
44
 * \page Def_Frame AST Multimedia and signalling frames
45
 * \section Def_AstFrame What is an ast_frame ?
45
 * \section Def_AstFrame What is an ast_frame ?
[+20] [20] 760 lines
  1. /branches/1.8/include/asterisk/frame.h: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.