Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270387
b: refs/heads/master
c: d5cf991
h: refs/heads/master
i:
  270385: 608a48a
  270383: 687e79c
v: v3
  • Loading branch information
Takashi Iwai committed Oct 6, 2011
1 parent 43185fd commit 9228cd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97999e28c74c5908445735ac282e8b20deb67b81
refs/heads/master: d5cf9911988287e819ce98ccd9f61ca82fbc90c6
9 changes: 6 additions & 3 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ struct azx_dev {
*/
unsigned char stream_tag; /* assigned stream */
unsigned char index; /* stream index */
int device; /* last device number assigned to */
int assigned_key; /* last device# key assigned to */

unsigned int opened :1;
unsigned int running :1;
Expand Down Expand Up @@ -1613,6 +1613,9 @@ azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream)
{
int dev, i, nums;
struct azx_dev *res = NULL;
/* make a non-zero unique key for the substream */
int key = (substream->pcm->device << 16) | (substream->number << 2) |
(substream->stream + 1);

if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
dev = chip->playback_index_offset;
Expand All @@ -1624,12 +1627,12 @@ azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream)
for (i = 0; i < nums; i++, dev++)
if (!chip->azx_dev[dev].opened) {
res = &chip->azx_dev[dev];
if (res->device == substream->pcm->device)
if (res->assigned_key == key)
break;
}
if (res) {
res->opened = 1;
res->device = substream->pcm->device;
res->assigned_key = key;
}
return res;
}
Expand Down

0 comments on commit 9228cd9

Please sign in to comment.