[ALSA] Use getnstimeofday()

Modules: Documentation,PCM Midlevel,Timer Midlevel,ALSA Core

Use the standard getnstimeofday() function instead of ALSA's own one.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2005-10-10 11:49:49 +02:00
committed by Jaroslav Kysela
parent 7c22f1aaa2
commit 07799e756c
6 changed files with 10 additions and 41 deletions

View File

@@ -29,7 +29,6 @@
#include <linux/pm.h> /* pm_message_t */
/* Typedef's */
typedef struct timespec snd_timestamp_t;
typedef struct sndrv_interval snd_interval_t;
typedef enum sndrv_card_type snd_card_type;
typedef struct sndrv_xferi snd_xferi_t;
@@ -464,28 +463,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
#endif
static inline void snd_timestamp_now(struct timespec *tstamp, int timespec)
{
struct timeval val;
/* FIXME: use a linear time source */
do_gettimeofday(&val);
tstamp->tv_sec = val.tv_sec;
tstamp->tv_nsec = val.tv_usec;
if (timespec)
tstamp->tv_nsec *= 1000L;
}
static inline void snd_timestamp_zero(struct timespec *tstamp)
{
tstamp->tv_sec = 0;
tstamp->tv_nsec = 0;
}
static inline int snd_timestamp_null(struct timespec *tstamp)
{
return tstamp->tv_sec == 0 && tstamp->tv_nsec == 0;
}
#define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0)) /* 3.8.1a */
/* for easier backward-porting */

View File

@@ -281,7 +281,7 @@ typedef struct {
struct _snd_pcm_runtime {
/* -- Status -- */
snd_pcm_substream_t *trigger_master;
snd_timestamp_t trigger_tstamp; /* trigger timestamp */
struct timespec trigger_tstamp; /* trigger timestamp */
int overrange;
snd_pcm_uframes_t avail_max;
snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */
@@ -306,7 +306,6 @@ struct _snd_pcm_runtime {
unsigned int rate_den;
/* -- SW params -- */
int tstamp_timespec; /* use timeval (0) or timespec (1) */
snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */
unsigned int period_step;
unsigned int sleep_min; /* min ticks to sleep */