]> git.alsa-project.org Git - alsa-utils.git/commitdiff
PCM loopback API improved and added back the functionality.
authorJaroslav Kysela <perex@perex.cz>
Tue, 30 Nov 1999 09:26:00 +0000 (09:26 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 30 Nov 1999 09:26:00 +0000 (09:26 +0000)
Some mmap() changes for the OSS emulation.

aplay/aplay.c

index 605c6e76c672834a137808fb4ce9d955746a0c6a..971657f7063577bde89981abee725acc0de01ed8 100644 (file)
@@ -34,6 +34,7 @@
 #include <getopt.h>
 #include <fcntl.h>
 #include <ctype.h>
+#include <errno.h>
 #include <netinet/in.h>
 #include <sys/asoundlib.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;
                                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);