X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=sound%2Fcore%2Fpcm_lib.c;h=93d7ca502730ce6b5f26a0127ae4da3013655612;hb=7c7fc2d44b7a660846115e65b67772b6742a14d8;hp=b336797be4fc877f4cd2ff0e8fa1e9e184ff2774;hpb=de9b2fccb6a1efdf1665ebbcb28cad61467b308a;p=linux-2.6 diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index b336797be4..93d7ca5027 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1,6 +1,6 @@ /* * Digital Audio (PCM) abstract layer - * Copyright (c) by Jaroslav Kysela + * Copyright (c) by Jaroslav Kysela * Abramo Bagnara * * @@ -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); @@ -781,6 +781,11 @@ int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int * { unsigned int k; int changed = 0; + + if (!count) { + i->empty = 1; + return -EINVAL; + } for (k = 0; k < count; k++) { if (mask && !(mask & (1 << k))) continue;