aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_native.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2008-01-11 02:45:08 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:54 -0500
commit8c12158687fc78091730d5456336b7efbf6f2250 (patch)
treef5b27075a4fde3f3eabbe7f05a12fec5559664b6 /sound/core/pcm_native.c
parenta64135a2d880183a2aff149f42dab7779a37a67f (diff)
[ALSA] PCM interface - rename SNDRV_PCM_TSTAMP_MMAP to SNDRV_PCM_TSTAMP_ENABLE
Change semantics for SNDRV_PCM_TSTAMP_MMAP. Doing timestamping only in the interrupt handler might cause that hw_ptr is not related to actual timestamp. With this change, grab timestamp at every hw_ptr update to have always valid timestamp + ring buffer position pair. With this change, SNDRV_PCM_TSTAMP_MMAP was renamed to SNDRV_PCM_TSTAMP_ENABLE. It's no regression (I think). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r--sound/core/pcm_native.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index e6e4aa87e57e..62449117ee14 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -580,9 +580,15 @@ int snd_pcm_status(struct snd_pcm_substream *substream,
580 if (status->state == SNDRV_PCM_STATE_OPEN) 580 if (status->state == SNDRV_PCM_STATE_OPEN)
581 goto _end; 581 goto _end;
582 status->trigger_tstamp = runtime->trigger_tstamp; 582 status->trigger_tstamp = runtime->trigger_tstamp;
583 if (snd_pcm_running(substream)) 583 if (snd_pcm_running(substream)) {
584 snd_pcm_update_hw_ptr(substream); 584 snd_pcm_update_hw_ptr(substream);
585 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) {
586 status->tstamp = runtime->status->tstamp;
587 goto _tstamp_end;
588 }
589 }
585 snd_pcm_gettime(runtime, &status->tstamp); 590 snd_pcm_gettime(runtime, &status->tstamp);
591 _tstamp_end:
586 status->appl_ptr = runtime->control->appl_ptr; 592 status->appl_ptr = runtime->control->appl_ptr;
587 status->hw_ptr = runtime->status->hw_ptr; 593 status->hw_ptr = runtime->status->hw_ptr;
588 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 594 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {