pcm: Implement timestamp type handling in all plugins

Now all PCM plugins do support the proper timestamp type or pass it
over slaves.  The internal monotonic flag is dropped and replaced with
tstamp_type in all places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2014-07-10 14:37:49 +02:00
parent 9b716075de
commit 65ff6fdafb
28 changed files with 73 additions and 58 deletions

View file

@ -195,7 +195,7 @@ static int snd_pcm_dshare_sync_ptr(snd_pcm_t *pcm)
dshare->avail_max = avail;
if (avail >= pcm->stop_threshold) {
snd_timer_stop(dshare->timer);
gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
gettimestamp(&dshare->trigger_tstamp, pcm->tstamp_type);
if (dshare->state == SND_PCM_STATE_RUNNING) {
dshare->state = SND_PCM_STATE_XRUN;
return -EPIPE;
@ -226,7 +226,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
memset(status, 0, sizeof(*status));
status->state = snd_pcm_state(dshare->spcm);
status->trigger_tstamp = dshare->trigger_tstamp;
gettimestamp(&status->tstamp, pcm->monotonic);
gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_mmap_playback_avail(pcm);
status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
dshare->avail_max = 0;
@ -346,7 +346,7 @@ static int snd_pcm_dshare_start(snd_pcm_t *pcm)
return err;
snd_pcm_dshare_sync_area(pcm);
}
gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
gettimestamp(&dshare->trigger_tstamp, pcm->tstamp_type);
return 0;
}
@ -792,7 +792,7 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dshare->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
pcm->monotonic = spcm->monotonic;
pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dshare->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dshare->appl_ptr, -1, 0);