From 8383eaf65c18e2ad60ce3c35d59026d1d3f23c07 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 28 Nov 2003 10:24:53 +0000 Subject: [PATCH] Fixed calc_count() routine - wav files with traling RIFF chunks sound ok now --- aplay/aplay.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/aplay/aplay.c b/aplay/aplay.c index e12589c..0373c70 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -1513,11 +1513,15 @@ static off64_t calc_count(void) { off64_t count; - if (!timelimit) { + if (!timelimit && pbrec_count == (size_t)-1) { count = (off64_t)-1; } else { - count = snd_pcm_format_size(hwparams.format, hwparams.rate * hwparams.channels); - count *= (off64_t)timelimit; + if (timelimit == 0) { + count = pbrec_count; + } else { + count = snd_pcm_format_size(hwparams.format, hwparams.rate * hwparams.channels); + count *= (off64_t)timelimit; + } } return count < pbrec_count ? count : pbrec_count; }