diff options
author | dvdli <70133153+dvdli@users.noreply.github.com> | 2022-05-17 16:36:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 16:36:36 +0800 |
commit | 2e6239c98492292be19e407ae08dbfd5047b6ad0 (patch) | |
tree | 8afdb15382e460e6a7e322488fa7431d0f16b8a6 /utils | |
parent | c127110249967e0722d80bb41e33713accdcff8f (diff) | |
parent | e5d56683935310d02d51952df2a9a89b17d7ce26 (diff) |
Merge pull request #225 from mikopp6/tinywavinfo_dev
Fixed bug with main analysis loop
Diffstat (limited to 'utils')
-rw-r--r-- | utils/tinywavinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/tinywavinfo.c b/utils/tinywavinfo.c index a74ca7d..301f8dc 100644 --- a/utils/tinywavinfo.c +++ b/utils/tinywavinfo.c @@ -185,7 +185,7 @@ void analyse_sample(FILE *file, unsigned int channels, unsigned int bits, if (num_read > 0) { if (2 == bytes_per_sample) { short *buffer_ptr = (short *)buffer; - for (i = 0; i < num_read; i += channels) { + for (i = 0; i < num_read / bytes_per_sample; i += channels) { for (ch = 0; ch < channels; ch++) { int temp = *buffer_ptr++; /* Signal Normalization */ @@ -196,7 +196,7 @@ void analyse_sample(FILE *file, unsigned int channels, unsigned int bits, } if (4 == bytes_per_sample) { int *buffer_ptr = (int *)buffer; - for (i = 0; i < num_read; i += channels) { + for (i = 0; i < num_read / bytes_per_sample; i += channels) { for (ch = 0; ch < channels; ch++) { int temp = *buffer_ptr++; /* Signal Normalization */ |