瀏覽代碼

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>
Takashi Iwai 12 年之前
父節點
當前提交
3f94fad095
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      sound/usb/pcm.c

+ 2 - 1
sound/usb/pcm.c

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