mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:25:43 +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
|
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
|
* 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;
|
ssize_t r;
|
||||||
size_t result = 0;
|
size_t result = 0;
|
||||||
|
size_t count = rcount;
|
||||||
|
|
||||||
|
if (mode == SND_PCM_MODE_FRAGMENT &&
|
||||||
|
count != buffer_size) {
|
||||||
|
count = buffer_size;
|
||||||
|
}
|
||||||
|
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
r = read_func(handle, data, count);
|
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;
|
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;
|
ssize_t r;
|
||||||
size_t result = 0;
|
size_t result = 0;
|
||||||
|
size_t count = rcount;
|
||||||
|
|
||||||
|
if (mode == SND_PCM_MODE_FRAGMENT &&
|
||||||
|
count != buffer_size) {
|
||||||
|
count = buffer_size;
|
||||||
|
}
|
||||||
|
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
unsigned int channel;
|
unsigned int channel;
|
||||||
|
@ -1030,7 +1042,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t count)
|
||||||
count -= r;
|
count -= r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return rcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue