Issue 1647. Avoid unsequenced modification.

issue=1647
test=trybots,manual

Review URL: https://webrtc-codereview.appspot.com/1327004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3858 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org 2013-04-16 17:01:35 +00:00
parent 6e788df19e
commit f1a3b4bc0c
2 changed files with 22 additions and 51 deletions

View File

@ -101,26 +101,9 @@
namespace webrtc {
// We dynamically allocate some of the dynamic payload types to the defined
// codecs. Note! There are a limited number of payload types. If more codecs
// are defined they will receive reserved fixed payload types (values 69-95).
const int kDynamicPayloadtypes[ACMCodecDB::kMaxNumCodecs] = {
107, 108, 109, 111, 112, 113, 114, 115, 116, 117, 92,
91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80,
79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
67, 66, 65
};
// Creates database with all supported codecs at compile time.
// Each entry needs the following parameters in the given order:
// payload type, name, sampling frequency, packet size in samples,
// number of channels, and default rate.
#if (defined(WEBRTC_CODEC_AMR) || defined(WEBRTC_CODEC_AMRWB) || \
defined(WEBRTC_CODEC_CELT) || defined(WEBRTC_CODEC_G722_1) || \
defined(WEBRTC_CODEC_G722_1C) || defined(WEBRTC_CODEC_G729_1) || \
defined(WEBRTC_CODEC_PCM16) || defined(WEBRTC_CODEC_SPEEX))
static int count_database = 0;
#endif
// Not yet used payload-types.
// 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
// 67, 66, 65
const CodecInst ACMCodecDB::database_[] = {
#if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
@ -132,13 +115,13 @@ const CodecInst ACMCodecDB::database_[] = {
#endif
#ifdef WEBRTC_CODEC_PCM16
// Mono
{kDynamicPayloadtypes[count_database++], "L16", 8000, 80, 1, 128000},
{kDynamicPayloadtypes[count_database++], "L16", 16000, 160, 1, 256000},
{kDynamicPayloadtypes[count_database++], "L16", 32000, 320, 1, 512000},
{107, "L16", 8000, 80, 1, 128000},
{108, "L16", 16000, 160, 1, 256000},
{109, "L16", 32000, 320, 1, 512000},
// Stereo
{kDynamicPayloadtypes[count_database++], "L16", 8000, 80, 2, 128000},
{kDynamicPayloadtypes[count_database++], "L16", 16000, 160, 2, 256000},
{kDynamicPayloadtypes[count_database++], "L16", 32000, 320, 2, 512000},
{111, "L16", 8000, 80, 2, 128000},
{112, "L16", 16000, 160, 2, 256000},
{113, "L16", 32000, 320, 2, 512000},
#endif
// G.711, PCM mu-law and A-law.
// Mono
@ -151,16 +134,16 @@ const CodecInst ACMCodecDB::database_[] = {
{102, "ILBC", 8000, 240, 1, 13300},
#endif
#ifdef WEBRTC_CODEC_AMR
{kDynamicPayloadtypes[count_database++], "AMR", 8000, 160, 1, 12200},
{114, "AMR", 8000, 160, 1, 12200},
#endif
#ifdef WEBRTC_CODEC_AMRWB
{kDynamicPayloadtypes[count_database++], "AMR-WB", 16000, 320, 1, 20000},
{115, "AMR-WB", 16000, 320, 1, 20000},
#endif
#ifdef WEBRTC_CODEC_CELT
// Mono
{kDynamicPayloadtypes[count_database++], "CELT", 32000, 640, 1, 64000},
{116, "CELT", 32000, 640, 1, 64000},
// Stereo
{kDynamicPayloadtypes[count_database++], "CELT", 32000, 640, 2, 64000},
{117, "CELT", 32000, 640, 2, 64000},
#endif
#ifdef WEBRTC_CODEC_G722
// Mono
@ -169,20 +152,20 @@ const CodecInst ACMCodecDB::database_[] = {
{119, "G722", 16000, 320, 2, 64000},
#endif
#ifdef WEBRTC_CODEC_G722_1
{kDynamicPayloadtypes[count_database++], "G7221", 16000, 320, 1, 32000},
{kDynamicPayloadtypes[count_database++], "G7221", 16000, 320, 1, 24000},
{kDynamicPayloadtypes[count_database++], "G7221", 16000, 320, 1, 16000},
{92, "G7221", 16000, 320, 1, 32000},
{91, "G7221", 16000, 320, 1, 24000},
{90, "G7221", 16000, 320, 1, 16000},
#endif
#ifdef WEBRTC_CODEC_G722_1C
{kDynamicPayloadtypes[count_database++], "G7221", 32000, 640, 1, 48000},
{kDynamicPayloadtypes[count_database++], "G7221", 32000, 640, 1, 32000},
{kDynamicPayloadtypes[count_database++], "G7221", 32000, 640, 1, 24000},
{89, "G7221", 32000, 640, 1, 48000},
{88, "G7221", 32000, 640, 1, 32000},
{87, "G7221", 32000, 640, 1, 24000},
#endif
#ifdef WEBRTC_CODEC_G729
{18, "G729", 8000, 240, 1, 8000},
#endif
#ifdef WEBRTC_CODEC_G729_1
{kDynamicPayloadtypes[count_database++], "G7291", 16000, 320, 1, 32000},
{86, "G7291", 16000, 320, 1, 32000},
#endif
#ifdef WEBRTC_CODEC_GSMFR
{3, "GSM", 8000, 160, 1, 13200},
@ -193,8 +176,8 @@ const CodecInst ACMCodecDB::database_[] = {
{120, "opus", 48000, 960, 2, 64000},
#endif
#ifdef WEBRTC_CODEC_SPEEX
{kDynamicPayloadtypes[count_database++], "speex", 8000, 160, 1, 11000},
{kDynamicPayloadtypes[count_database++], "speex", 16000, 320, 1, 22000},
{85, "speex", 8000, 160, 1, 11000},
{84, "speex", 16000, 320, 1, 22000},
#endif
// Comfort noise for four different sampling frequencies.
{13, "CN", 8000, 240, 1, 0},

View File

@ -106,18 +106,6 @@
'audio_coding_module_impl.cc',
'audio_coding_module_impl.h',
],
'conditions': [
['clang==1', {
'cflags': [
'-Wno-unsequenced',
],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wno-unsequenced',
],
},
}],
],
},
],
'conditions': [