Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c7fc2d44b7a660846115e65b67772b6742a14d8
Commit:     7c7fc2d44b7a660846115e65b67772b6742a14d8
Parent:     7f6301cdfad5469312d266bcec3f1a02a8e8b5af
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 23 13:14:23 2007 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Thu Jan 31 17:29:28 2008 +0100

    [ALSA] Fix PCM MMAP time-stamp mode
    
    When MMAP time-stamp mode is given, it's supposed to update the time-stamp
    only at period boundary.  However, it currently updates at each status call
    so this is just useless.  The patch fixes this misbehavior.
    Also it fixes the wrong check of tstamp_mode (don't use bit-and for enum).
    
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/core/pcm_lib.c    |    4 ++--
 sound/core/pcm_native.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 806f1fb..93d7ca5 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -148,8 +148,6 @@ static inline snd_pcm_uframes_t 
snd_pcm_update_hw_ptr_pos(struct snd_pcm_substre
        pos = substream->ops->pointer(substream);
        if (pos == SNDRV_PCM_POS_XRUN)
                return pos; /* XRUN */
-       if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP)
-               getnstimeofday((struct timespec *)&runtime->status->tstamp);
 #ifdef CONFIG_SND_DEBUG
        if (pos >= runtime->buffer_size) {
                snd_printk(KERN_ERR  "BUG: stream = %i, pos = 0x%lx, buffer 
size = 0x%lx, period size = 0x%lx\n", substream->stream, pos, 
runtime->buffer_size, runtime->period_size);
@@ -189,6 +187,8 @@ static inline int snd_pcm_update_hw_ptr_interrupt(struct 
snd_pcm_substream *subs
        snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt;
        snd_pcm_sframes_t delta;
 
+       if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
+               getnstimeofday((struct timespec *)&runtime->status->tstamp);
        pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
        if (pos == SNDRV_PCM_POS_XRUN) {
                xrun(substream);
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index fb3dde4..6245bda 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -595,7 +595,7 @@ int snd_pcm_status(struct snd_pcm_substream *substream,
        status->trigger_tstamp = runtime->trigger_tstamp;
        if (snd_pcm_running(substream)) {
                snd_pcm_update_hw_ptr(substream);
-               if (runtime->tstamp_mode & SNDRV_PCM_TSTAMP_MMAP)
+               if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
                        status->tstamp = runtime->status->tstamp;
                else
                        getnstimeofday(&status->tstamp);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to