aplay: fix the capture file length regression

The commit 4b959a4 ("aplay: Fix for arecord recording ghost data")
intruduced a regression (file may contain more samples than
expected). Correct this.

Fixes: https://github.com/alsa-project/alsa-utils/issues/163
Fixes: 4b959a4 ("aplay: Fix for arecord recording ghost data")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2022-08-03 22:09:45 +02:00
parent a566f8a0ed
commit 6ee086363a

View file

@ -2268,7 +2268,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
}
}
abort:
return result;
return result > rcount ? rcount : result;
}
static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)