aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-23 08:28:42 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-23 09:37:32 -0500
commit3f94fad09538ec988919ec3f371841182df71d04 (patch)
treec37b1d2d412850ae03c0d4ffc9a8cd585eab866a
parentffe4d12b151018e831f0ca2e05fe78a55238c517 (diff)
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>
-rw-r--r--sound/usb/pcm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index e919c2e40fa0..8e1d5e00c182 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -75,7 +75,8 @@ static snd_pcm_uframes_t snd_usb_pcm_pointer(struct snd_pcm_substream *substream
75 return SNDRV_PCM_POS_XRUN; 75 return SNDRV_PCM_POS_XRUN;
76 spin_lock(&subs->lock); 76 spin_lock(&subs->lock);
77 hwptr_done = subs->hwptr_done; 77 hwptr_done = subs->hwptr_done;
78 substream->runtime->delay = snd_usb_pcm_delay(subs, 78 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
79 substream->runtime->delay = snd_usb_pcm_delay(subs,
79 substream->runtime->rate); 80 substream->runtime->rate);
80 spin_unlock(&subs->lock); 81 spin_unlock(&subs->lock);
81 return hwptr_done / (substream->runtime->frame_bits >> 3); 82 return hwptr_done / (substream->runtime->frame_bits >> 3);