aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_lib.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_lib.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_lib.c')
-rw-r--r--sound/core/pcm_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index ed0223ca5c55..1533f0379e9d 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -144,6 +144,8 @@ static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(struct snd_pcm_substre
144{ 144{
145 snd_pcm_uframes_t pos; 145 snd_pcm_uframes_t pos;
146 146
147 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
148 snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
147 pos = substream->ops->pointer(substream); 149 pos = substream->ops->pointer(substream);
148 if (pos == SNDRV_PCM_POS_XRUN) 150 if (pos == SNDRV_PCM_POS_XRUN)
149 return pos; /* XRUN */ 151 return pos; /* XRUN */
@@ -186,8 +188,6 @@ static inline int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *subs
186 snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt; 188 snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt;
187 snd_pcm_sframes_t delta; 189 snd_pcm_sframes_t delta;
188 190
189 if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
190 snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
191 pos = snd_pcm_update_hw_ptr_pos(substream, runtime); 191 pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
192 if (pos == SNDRV_PCM_POS_XRUN) { 192 if (pos == SNDRV_PCM_POS_XRUN) {
193 xrun(substream); 193 xrun(substream);