Fixed calc_count() routine - wav files with traling RIFF chunks sound ok now

This commit is contained in:
Jaroslav Kysela 2003-11-28 10:24:53 +00:00
parent 911e5f7248
commit 8383eaf65c

View file

@ -1513,11 +1513,15 @@ static off64_t calc_count(void)
{ {
off64_t count; off64_t count;
if (!timelimit) { if (!timelimit && pbrec_count == (size_t)-1) {
count = (off64_t)-1; count = (off64_t)-1;
} else { } else {
count = snd_pcm_format_size(hwparams.format, hwparams.rate * hwparams.channels); if (timelimit == 0) {
count *= (off64_t)timelimit; 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; return count < pbrec_count ? count : pbrec_count;
} }