Browse Source

ALSA: hda - Judge playback stream from stream id in azx_via_get_position()

Instead of checking the azx_dev index with a fixed number (4), check
the stream direction of the assigned substream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 14 years ago
parent
commit
b4a655e81d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      sound/pci/hda/hda_intel.c

+ 1 - 1
sound/pci/hda/hda_intel.c

@@ -1866,7 +1866,7 @@ static unsigned int azx_via_get_position(struct azx *chip,
 	unsigned int fifo_size;
 
 	link_pos = azx_sd_readl(azx_dev, SD_LPIB);
-	if (azx_dev->index >= 4) {
+	if (azx_dev->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		/* Playback, no problem using link position */
 		return link_pos;
 	}