comparison src/sound.c @ 2467:cd81f1f2c896

[gaim-migrate @ 2480] bmiller's solaris sound patch committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 09 Oct 2001 23:15:33 +0000
parents 2927c2c26fe6
children ad4a0b3f0032
comparison
equal deleted inserted replaced
2466:f8eb5f120603 2467:cd81f1f2c896
80 80
81 static void play_audio(unsigned char *data, int size) 81 static void play_audio(unsigned char *data, int size)
82 { 82 {
83 int fd; 83 int fd;
84 84
85 fd = open("/dev/audio", O_WRONLY | O_EXCL); 85 fd = open("/dev/audio", O_WRONLY | O_EXCL | O_NDELAY);
86 if (fd < 0) 86 if (fd < 0)
87 return; 87 return;
88 write(fd, data, size); 88 write(fd, data, size);
89 close(fd); 89 close(fd);
90 } 90 }
104 buf = malloc(info.st_size + 1); 104 buf = malloc(info.st_size + 1);
105 read(fd, buf, 24); 105 read(fd, buf, 24);
106 read(fd, buf, info.st_size - 24); 106 read(fd, buf, info.st_size - 24);
107 close(fd); 107 close(fd);
108 108
109 fd = open("/dev/audio", O_WRONLY | O_EXCL); 109 fd = open("/dev/audio", O_WRONLY | O_EXCL | O_NDELAY);
110 if (fd < 0) { 110 if (fd < 0) {
111 free(buf); 111 free(buf);
112 return; 112 return;
113 } 113 }
114 write(fd, buf, info.st_size - 24); 114 write(fd, buf, info.st_size - 24);