]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Fixed calc_count() routine - wav files with traling RIFF chunks sound ok now
authorJaroslav Kysela <perex@perex.cz>
Fri, 28 Nov 2003 10:24:53 +0000 (10:24 +0000)
committerJaroslav Kysela <perex@perex.cz>
Fri, 28 Nov 2003 10:24:53 +0000 (10:24 +0000)
aplay/aplay.c

index e12589c571431d0de53b5933a6ac3699ca2e44d0..0373c7079ac36d250a726760654f077bc7dc9709 100644 (file)
@@ -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;
 }