PCM loopback API improved and added back the functionality.

Some mmap() changes for the OSS emulation.
This commit is contained in:
Jaroslav Kysela 1999-11-30 09:26:00 +00:00
parent 924b1d976a
commit d162b1026f

View file

@ -34,6 +34,7 @@
#include <getopt.h> #include <getopt.h>
#include <fcntl.h> #include <fcntl.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
#include "aconfig.h" #include "aconfig.h"
@ -1224,6 +1225,10 @@ void playback_go(int fd, int loaded, u_long count, int rtype, char *name)
char *buf = audiobuf; char *buf = audiobuf;
while (l > 0) { while (l > 0) {
while ((r = fcn_write(pcm_handle, buf, l)) < 0) { while ((r = fcn_write(pcm_handle, buf, l)) < 0) {
if (r == -EAGAIN) {
r = 0;
break;
}
playback_write_error(); playback_write_error();
} }
#if 0 #if 0
@ -1311,6 +1316,8 @@ void capture_go(int fd, int loaded, u_long count, int rtype, char *name)
} }
count -= c; count -= c;
} }
if (l == -EAGAIN)
l = 0;
if (l < 0) { if (l < 0) {
fprintf(stderr, "read error: %s\n", snd_strerror(l)); fprintf(stderr, "read error: %s\n", snd_strerror(l));
exit(-1); exit(-1);