Update of /cvsroot/alsa/alsa-oss/oss-redir
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16222
Modified Files:
oss-redir.c oss-redir.h
Log Message:
Added pcm_nonblock callback
Index: oss-redir.c
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/oss-redir/oss-redir.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- oss-redir.c 9 Feb 2004 13:07:27 -0000 1.2
+++ oss-redir.c 9 Feb 2004 14:31:13 -0000 1.3
@@ -59,7 +59,22 @@
static int (*x_oss_mixer_close)(int fd);
int (*oss_mixer_ioctl)(int fd, unsigned long int request, ...);
-int native_pcm_select_prepare(int fd, fd_set *readfds, fd_set *writefds)
+static int native_pcm_nonblock(int fd, int nonblock)
+{
+ long flags;
+
+ if ((flags = fcntl(fd, F_GETFL)) < 0)
+ return -1;
+ if (nonblock)
+ flags |= O_NONBLOCK;
+ else
+ flags &= ~O_NONBLOCK;
+ if (fcntl(fd, F_SETFL, flags) < 0)
+ return -1;
+ return 0;
+}
+
+static int native_pcm_select_prepare(int fd, fd_set *readfds, fd_set *writefds)
{
if (fd < 0)
return -EINVAL;
@@ -70,7 +85,7 @@
return 0;
}
-int native_pcm_select_result(int fd, fd_set *readfds, fd_set *writefds)
+static int native_pcm_select_result(int fd, fd_set *readfds, fd_set *writefds)
{
int result = 0;
@@ -83,14 +98,14 @@
return result;
}
-int native_pcm_poll_fds(int fd)
+static int native_pcm_poll_fds(int fd)
{
if (fd < 0)
return -EINVAL;
return 1;
}
-int native_pcm_poll_prepare(int fd, struct pollfd *ufds)
+static int native_pcm_poll_prepare(int fd, struct pollfd *ufds)
{
if (fd < 0)
return -EINVAL;
@@ -99,7 +114,7 @@
return 0;
}
-int native_pcm_poll_result(int fd, struct pollfd *ufds)
+static int native_pcm_poll_result(int fd, struct pollfd *ufds)
{
int result = 0;
@@ -197,6 +212,7 @@
}
if (native_oss) {
__native:
+ oss_pcm_nonblock = native_pcm_nonblock;
oss_pcm_read = read;
oss_pcm_write = write;
oss_pcm_mmap = mmap;
@@ -218,6 +234,7 @@
}
x_oss_pcm_open = dlsym(dl_handle, "lib_oss_pcm_open");
x_oss_pcm_close = dlsym(dl_handle, "lib_oss_pcm_close");
+ oss_pcm_nonblock = dlsym(dl_handle, "lib_oss_pcm_nonblock");
oss_pcm_read = dlsym(dl_handle, "lib_oss_pcm_read");
oss_pcm_write = dlsym(dl_handle, "lib_oss_pcm_write");
oss_pcm_mmap = dlsym(dl_handle, "lib_oss_pcm_mmap");
Index: oss-redir.h
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/oss-redir/oss-redir.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- oss-redir.h 9 Feb 2004 13:07:27 -0000 1.2
+++ oss-redir.h 9 Feb 2004 14:31:13 -0000 1.3
@@ -30,6 +30,7 @@
extern int oss_pcm_open(const char *pathname, int flags, ...);
extern int oss_pcm_close(int fd);
+extern int (*oss_pcm_nonblock)(int fd, int nonblock);
extern ssize_t (*oss_pcm_read)(int fd, void *buf, size_t count);
extern ssize_t (*oss_pcm_write)(int fd, const void *buf, size_t count);
extern void * (*oss_pcm_mmap)(void *start, size_t length, int prot, int flags, int
fd, off_t offset);
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog