From d162b1026fbb95426f185dff557ab5e77194b1b3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 30 Nov 1999 09:26:00 +0000 Subject: [PATCH] PCM loopback API improved and added back the functionality. Some mmap() changes for the OSS emulation. --- aplay/aplay.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aplay/aplay.c b/aplay/aplay.c index 605c6e7..971657f 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include "aconfig.h" @@ -1224,6 +1225,10 @@ void playback_go(int fd, int loaded, u_long count, int rtype, char *name) char *buf = audiobuf; while (l > 0) { while ((r = fcn_write(pcm_handle, buf, l)) < 0) { + if (r == -EAGAIN) { + r = 0; + break; + } playback_write_error(); } #if 0 @@ -1311,6 +1316,8 @@ void capture_go(int fd, int loaded, u_long count, int rtype, char *name) } count -= c; } + if (l == -EAGAIN) + l = 0; if (l < 0) { fprintf(stderr, "read error: %s\n", snd_strerror(l)); exit(-1);