Update of /cvsroot/alsa/alsa-oss/oss-redir
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25512/oss-redir
Modified Files:
oss-redir.c oss-redir.h
Log Message:
- a try to let OSS mmap mode work with dmix plugin
- call avail_update in GETIPTR and GETOPTR functions (fixme)
- fixed/enhanced semantics of select_prepare (should work now)
Index: oss-redir.c
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/oss-redir/oss-redir.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- oss-redir.c 14 Feb 2004 18:42:18 -0000 1.6
+++ oss-redir.c 18 Feb 2004 20:17:05 -0000 1.7
@@ -50,10 +50,10 @@
void * (*oss_pcm_mmap)(void *start, size_t length, int prot, int flags, int fd, off_t
offset);
int (*oss_pcm_munmap)(void *start, size_t length);
int (*oss_pcm_ioctl)(int fd, unsigned long int request, ...);
-int (*oss_pcm_select_prepare)(int fd, fd_set *readfds, fd_set *writefds, fd_set
*exceptfds);
+int (*oss_pcm_select_prepare)(int fd, int fmode, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds);
int (*oss_pcm_select_result)(int fd, fd_set *readfds, fd_set *writefds, fd_set
*exceptfds);
int (*oss_pcm_poll_fds)(int fd);
-int (*oss_pcm_poll_prepare)(int fd, struct pollfd *ufds);
+int (*oss_pcm_poll_prepare)(int fd, int fmode, struct pollfd *ufds);
int (*oss_pcm_poll_result)(int fd, struct pollfd *ufds);
static int (*x_oss_mixer_open)(const char *pathname, int flags);
@@ -75,21 +75,21 @@
return 0;
}
-static int native_pcm_select_prepare(int fd, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds)
+static int native_pcm_select_prepare(int fd, int fmode, fd_set *readfds, fd_set
*writefds, fd_set *exceptfds)
{
if (fd < 0)
return -EINVAL;
- if (readfds) {
+ if ((fmode & O_ACCMODE) != O_WRONLY && readfds) {
FD_SET(fd, readfds);
if (exceptfds)
FD_SET(fd, exceptfds);
}
- if (writefds) {
+ if ((fmode & O_ACCMODE) != O_RDONLY && writefds) {
FD_SET(fd, writefds);
if (exceptfds)
FD_SET(fd, exceptfds);
}
- return 0;
+ return fd;
}
static int native_pcm_select_result(int fd, fd_set *readfds, fd_set *writefds, fd_set
*exceptfds)
@@ -114,13 +114,14 @@
return 1;
}
-static int native_pcm_poll_prepare(int fd, struct pollfd *ufds)
+static int native_pcm_poll_prepare(int fd, int fmode, struct pollfd *ufds)
{
if (fd < 0)
return -EINVAL;
ufds->fd = fd;
- ufds->events = POLLIN | POLLOUT | POLLERR;
- return 0;
+ ufds->events = ((fmode & O_ACCMODE) == O_WRONLY ? 0 : POLLIN) |
+ ((fmode & O_ACCMODE) == O_RDONLY ? 0 : POLLOUT) | POLLERR;
+ return 1;
}
static int native_pcm_poll_result(int fd, struct pollfd *ufds)
Index: oss-redir.h
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/oss-redir/oss-redir.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- oss-redir.h 12 Feb 2004 17:16:07 -0000 1.5
+++ oss-redir.h 18 Feb 2004 20:17:05 -0000 1.6
@@ -41,10 +41,10 @@
extern void * (*oss_pcm_mmap)(void *start, size_t length, int prot, int flags, int
fd, off_t offset);
extern int (*oss_pcm_munmap)(void *start, size_t length);
extern int (*oss_pcm_ioctl)(int fd, unsigned long int request, ...);
-extern int (*oss_pcm_select_prepare)(int fd, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds);
+extern int (*oss_pcm_select_prepare)(int fd, int fmode, fd_set *readfds, fd_set
*writefds, fd_set *exceptfds);
extern int (*oss_pcm_select_result)(int fd, fd_set *readfds, fd_set *writefds, fd_set
*exceptfds);
extern int (*oss_pcm_poll_fds)(int fd);
-extern int (*oss_pcm_poll_prepare)(int fd, struct pollfd *ufds);
+extern int (*oss_pcm_poll_prepare)(int fd, int fmode, struct pollfd *ufds);
extern int (*oss_pcm_poll_result)(int fd, struct pollfd *ufds);
extern int oss_mixer_open(const char *pathname, int flags, ...);
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog