Fixed arecord bug wrt time limit

This commit is contained in:
Abramo Bagnara 2000-07-06 17:20:49 +00:00
parent f46d20e4b2
commit c88189e490
2 changed files with 16 additions and 5 deletions

1
TODO
View file

@ -1,2 +1 @@
M Fix arecord timelimit bug
M Write a *good* mixer

View file

@ -972,10 +972,16 @@ static ssize_t pcm_writev(u_char **data, unsigned int channels, size_t count)
* read function
*/
static ssize_t pcm_read(u_char *data, size_t count)
static ssize_t pcm_read(u_char *data, size_t rcount)
{
ssize_t r;
size_t result = 0;
size_t count = rcount;
if (mode == SND_PCM_MODE_FRAGMENT &&
count != buffer_size) {
count = buffer_size;
}
while (count > 0) {
r = read_func(handle, data, count);
@ -996,13 +1002,19 @@ static ssize_t pcm_read(u_char *data, size_t count)
data += r * bits_per_frame / 8;
}
}
return result;
return rcount;
}
static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t count)
static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
{
ssize_t r;
size_t result = 0;
size_t count = rcount;
if (mode == SND_PCM_MODE_FRAGMENT &&
count != buffer_size) {
count = buffer_size;
}
while (count > 0) {
unsigned int channel;
@ -1030,7 +1042,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t count)
count -= r;
}
}
return result;
return rcount;
}
/*