mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Clean up using gettimestamp()
Introduce a new local function gettimestamp() to get the current timestamp.
This commit is contained in:
parent
7379b061eb
commit
683c8bc4a2
8 changed files with 28 additions and 66 deletions
|
|
@ -82,13 +82,10 @@ static int snd_pcm_null_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
|||
static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
||||
{
|
||||
snd_pcm_null_t *null = pcm->private_data;
|
||||
struct timeval tv;
|
||||
memset(status, 0, sizeof(*status));
|
||||
status->state = null->state;
|
||||
status->trigger_tstamp = null->trigger_tstamp;
|
||||
gettimeofday(&tv, 0);
|
||||
status->tstamp.tv_sec = tv.tv_sec;
|
||||
status->tstamp.tv_nsec = tv.tv_usec * 1000L;
|
||||
gettimestamp(&status->tstamp);
|
||||
status->avail = pcm->buffer_size;
|
||||
status->avail_max = status->avail;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue