ALSA: usb-audio: ignore delay calculation for capture stream

It doesn't make sense to calculate the delay for capture streams in
the current implementation.  It's always zero, so we should skip the
computation in snd_usb_pcm_pointer() in the case of capture.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2012-11-23 14:28:42 +01:00
parent ffe4d12b15
commit 3f94fad095
1 changed files with 2 additions and 1 deletions

View File

@ -75,6 +75,7 @@ static snd_pcm_uframes_t snd_usb_pcm_pointer(struct snd_pcm_substream *substream
return SNDRV_PCM_POS_XRUN; return SNDRV_PCM_POS_XRUN;
spin_lock(&subs->lock); spin_lock(&subs->lock);
hwptr_done = subs->hwptr_done; hwptr_done = subs->hwptr_done;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
substream->runtime->delay = snd_usb_pcm_delay(subs, substream->runtime->delay = snd_usb_pcm_delay(subs,
substream->runtime->rate); substream->runtime->rate);
spin_unlock(&subs->lock); spin_unlock(&subs->lock);