summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/aiff_enc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c
index 50c682fa31..8b6e2217c9 100644
--- a/apps/codecs/aiff_enc.c
+++ b/apps/codecs/aiff_enc.c
@@ -83,8 +83,8 @@ uint32_t sample_rate;
83uint32_t enc_size; 83uint32_t enc_size;
84 84
85/* convert unsigned 32 bit value to 80-bit floating point number */ 85/* convert unsigned 32 bit value to 80-bit floating point number */
86static void uint32_to_ieee754_extended(uint8_t f[10], uint32_t l) ICODE_ATTR; 86static void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l) ICODE_ATTR;
87static void uint32_to_ieee754_extended(uint8_t f[10], uint32_t l) 87static void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l)
88{ 88{
89 int32_t exp; 89 int32_t exp;
90 90
@@ -103,7 +103,7 @@ static void uint32_to_ieee754_extended(uint8_t f[10], uint32_t l)
103 /* mantissa is value left justified with most significant non-zero 103 /* mantissa is value left justified with most significant non-zero
104 bit stored in bit 63 - bits 0-63 */ 104 bit stored in bit 63 - bits 0-63 */
105 *(uint32_t *)&f[2] = htobe32(l); 105 *(uint32_t *)&f[2] = htobe32(l);
106} /* long_to_ieee754_extended */ 106} /* uint32_h_to_ieee754_extended_be */
107 107
108/* called version often - inline */ 108/* called version often - inline */
109static inline bool is_file_data_ok(struct enc_file_event_data *data) ICODE_ATTR; 109static inline bool is_file_data_ok(struct enc_file_event_data *data) ICODE_ATTR;
@@ -177,12 +177,12 @@ static bool on_end_file(struct enc_file_event_data *data)
177 data_size = data->num_pcm_samples*num_channels*PCM_DEPTH_BYTES; 177 data_size = data->num_pcm_samples*num_channels*PCM_DEPTH_BYTES;
178 178
179 /* 'FORM' chunk */ 179 /* 'FORM' chunk */
180 hdr.form_size = data_size + sizeof (hdr) - 8; 180 hdr.form_size = htobe32(data_size + sizeof (hdr) - 8);
181 181
182 /* 'COMM' chunk */ 182 /* 'COMM' chunk */
183 hdr.num_channels = htobe16(num_channels); 183 hdr.num_channels = htobe16(num_channels);
184 hdr.num_sample_frames = htobe32(data->num_pcm_samples*num_channels/2); 184 hdr.num_sample_frames = htobe32(data->num_pcm_samples);
185 uint32_to_ieee754_extended(hdr.sample_rate, sample_rate); 185 uint32_h_to_ieee754_extended_be(hdr.sample_rate, sample_rate);
186 186
187 /* 'SSND' chunk */ 187 /* 'SSND' chunk */
188 hdr.ssnd_size = htobe32(data_size + 8); 188 hdr.ssnd_size = htobe32(data_size + 8);