From bf3157320446ebbe15479176a21cc0ee9f83e7e6 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 24 Dec 2017 01:31:43 +0100 Subject: [PATCH] Fix minor bytes-to-samples round error in some IMA formats --- src/coding/ima_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coding/ima_decoder.c b/src/coding/ima_decoder.c index c8f56ef1..60a84ef1 100644 --- a/src/coding/ima_decoder.c +++ b/src/coding/ima_decoder.c @@ -792,7 +792,7 @@ size_t ms_ima_bytes_to_samples(size_t bytes, int block_align, int channels) { size_t ima_bytes_to_samples(size_t bytes, int channels) { /* 2 samples per byte (2 nibbles) in stereo or mono config */ - return bytes / channels * 2; + return bytes * 2 / channels; } size_t ubi_ima_bytes_to_samples(size_t bytes, int channels, STREAMFILE *streamFile, off_t offset) {