mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 07:16:31 +01:00
Fixed arecord bug wrt time limit
This commit is contained in:
parent
f46d20e4b2
commit
c88189e490
2 changed files with 16 additions and 5 deletions
1
TODO
1
TODO
|
@ -1,2 +1 @@
|
|||
M Fix arecord timelimit bug
|
||||
M Write a *good* mixer
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue