mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:35:42 +01:00
- fixed the capture to stdout in WAV.
- allow more than 32bit int in the raw capture mode.
This commit is contained in:
parent
093a701102
commit
436b33787d
1 changed files with 21 additions and 16 deletions
|
@ -1527,6 +1527,10 @@ static void begin_wave(int fd, size_t cnt)
|
|||
u_int tmp;
|
||||
u_short tmp2;
|
||||
|
||||
/* WAVE cannot handle greater than 32bit (signed?) int */
|
||||
if (cnt == (size_t)-2)
|
||||
cnt = 0x7fffff00;
|
||||
|
||||
bits = 8;
|
||||
switch ((unsigned long) hwparams.format) {
|
||||
case SND_PCM_FORMAT_U8:
|
||||
|
@ -1754,14 +1758,15 @@ void playback_go(int fd, size_t loaded, size_t count, int rtype, char *name)
|
|||
|
||||
void capture_go(int fd, size_t count, int rtype, char *name)
|
||||
{
|
||||
size_t c;
|
||||
size_t c, cur;
|
||||
ssize_t r, err;
|
||||
|
||||
header(rtype, name);
|
||||
set_params();
|
||||
|
||||
while (count > 0) {
|
||||
c = count;
|
||||
do {
|
||||
for (cur = count; cur > 0; cur -= r) {
|
||||
c = cur;
|
||||
if (c > chunk_bytes)
|
||||
c = chunk_bytes;
|
||||
c = c * 8 / bits_per_frame;
|
||||
|
@ -1774,8 +1779,8 @@ void capture_go(int fd, size_t count, int rtype, char *name)
|
|||
}
|
||||
if (err > 0)
|
||||
fdcount += err;
|
||||
count -= r;
|
||||
}
|
||||
} while (rtype == FORMAT_RAW && !timelimit);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue