Update of /cvsroot/alsa/alsa-lib/src/timer
In directory sc8-pr-cvs1:/tmp/cvs-serv19934/src/timer
Modified Files:
timer_hw.c timer_local.h
Log Message:
Timer cleanups against the latest API
Index: timer_hw.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/timer/timer_hw.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- timer_hw.c 6 Feb 2003 19:16:08 -0000 1.9
+++ timer_hw.c 2 Mar 2003 19:30:52 -0000 1.10
@@ -34,7 +34,9 @@
#endif
#define SNDRV_FILE_TIMER "/dev/snd/timer"
-#define SNDRV_TIMER_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 0)
+#define SNDRV_TIMER_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 1)
+
+#define SNDRV_TIMER_IOCTL_STATUS_OLD _IOW('T', 0x14, struct sndrv_timer_status)
static int snd_timer_hw_close(snd_timer_t *handle)
{
@@ -121,11 +123,16 @@
static int snd_timer_hw_status(snd_timer_t *handle, snd_timer_status_t * status)
{
snd_timer_t *tmr;
+ int cmd;
tmr = handle;
if (!tmr || !status)
return -EINVAL;
- if (ioctl(tmr->poll_fd, SNDRV_TIMER_IOCTL_STATUS, status) < 0)
+ if (tmr->version < SNDRV_PROTOCOL_VERSION(2, 0, 1))
+ cmd = SNDRV_TIMER_IOCTL_STATUS_OLD;
+ else
+ cmd = SNDRV_TIMER_IOCTL_STATUS;
+ if (ioctl(tmr->poll_fd, cmd, status) < 0)
return -errno;
return 0;
}
@@ -243,6 +250,7 @@
return -ENOMEM;
}
tmr->type = SND_TIMER_TYPE_HW;
+ tmr->version = ver;
tmr->mode = tmode;
tmr->name = strdup(name);
tmr->poll_fd = fd;
Index: timer_local.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/timer/timer_local.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- timer_local.h 6 Feb 2003 19:16:09 -0000 1.3
+++ timer_local.h 2 Mar 2003 19:30:52 -0000 1.4
@@ -38,6 +38,7 @@
} snd_timer_ops_t;
struct _snd_timer {
+ unsigned int version;
char *name;
snd_timer_type_t type;
int mode;
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog