Commit a657ba9f authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

siren: Make some local variables non-static for thread-safety

Otherwise we will override values from another thread if we encode
or decode frames at the same time in different threads.
parent 80e02cbd
......@@ -82,10 +82,10 @@ Siren7_DecodeFrame (SirenDecoder decoder, unsigned char *DataIn,
scale_factor, number_of_regions, sample_rate_code, bits_per_frame;
int decoded_sample_rate_code;
static int absolute_region_power_index[28] = { 0 };
static float decoder_standard_deviation[28] = { 0 };
static int power_categories[28] = { 0 };
static int category_balance[28] = { 0 };
int absolute_region_power_index[28] = { 0 };
float decoder_standard_deviation[28] = { 0 };
int power_categories[28] = { 0 };
int category_balance[28] = { 0 };
int ChecksumTable[4] = { 0x7F80, 0x7878, 0x6666, 0x5555 };
int i, j;
......
......@@ -82,13 +82,13 @@ Siren7_EncodeFrame (SirenEncoder encoder, unsigned char *DataIn,
scale_factor, number_of_regions, sample_rate_code, bits_per_frame;
int sample_rate = encoder->sample_rate;
static int absolute_region_power_index[28] = { 0 };
static int power_categories[28] = { 0 };
static int category_balance[28] = { 0 };
static int drp_num_bits[30] = { 0 };
static int drp_code_bits[30] = { 0 };
static int region_mlt_bit_counts[28] = { 0 };
static int region_mlt_bits[112] = { 0 };
int absolute_region_power_index[28] = { 0 };
int power_categories[28] = { 0 };
int category_balance[28] = { 0 };
int drp_num_bits[30] = { 0 };
int drp_code_bits[30] = { 0 };
int region_mlt_bit_counts[28] = { 0 };
int region_mlt_bits[112] = { 0 };
int ChecksumTable[4] = { 0x7F80, 0x7878, 0x6666, 0x5555 };
int i, j;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment