aboutsummaryrefslogtreecommitdiff
path: root/tinycap.c
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2012-04-05 19:28:00 -0500
committerMisael Lopez Cruz <misael.lopez@ti.com>2012-04-05 19:35:14 -0500
commitfba29e6b27645c6b1a450be384d878b8ea38c592 (patch)
tree554a393b6242e7e5fb908aff3a468117204bda4d /tinycap.c
parent8fe2c93b75112bce4de1a08f61eca9c509d770c1 (diff)
tinycap: Fix byte_rate and block_align values
'byte_rate' and 'block_align' sections of the WAV header were calculated using an invalid 'bits_per_sample' value. 'bits_per_sample' is now set before it gets used by other fields. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'tinycap.c')
-rw-r--r--tinycap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tinycap.c b/tinycap.c
index dcc238c..d563309 100644
--- a/tinycap.c
+++ b/tinycap.c
@@ -136,9 +136,9 @@ int main(int argc, char **argv)
header.audio_format = FORMAT_PCM;
header.num_channels = channels;
header.sample_rate = rate;
+ header.bits_per_sample = bits;
header.byte_rate = (header.bits_per_sample / 8) * channels * rate;
header.block_align = channels * (header.bits_per_sample / 8);
- header.bits_per_sample = bits;
header.data_id = ID_DATA;
/* leave enough room for header */