Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199778
b: refs/heads/master
c: 67e1daa
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed May 31, 2010
1 parent 36c78a4 commit f0510f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 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: 2e0281d15c220d0a81c45c73872aa08d2f3ae3ef
refs/heads/master: 67e1daa0bb30eda6ec5add27c3abf4536030f5a6
18 changes: 10 additions & 8 deletions trunk/sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,24 @@ static int check_mapped_selector_name(struct mixer_build *state, int unitid,

/*
* find an audio control unit with the given unit id
* this doesn't return any clock related units, so they need to be handled elsewhere
*/
static void *find_audio_control_unit(struct mixer_build *state, unsigned char unit)
{
unsigned char *p;
/* we just parse the header */
struct uac_feature_unit_descriptor *hdr = NULL;

p = NULL;
while ((p = snd_usb_find_desc(state->buffer, state->buflen, p,
USB_DT_CS_INTERFACE)) != NULL) {
if (p[0] >= 4 && p[2] >= UAC_INPUT_TERMINAL && p[2] <= UAC2_EXTENSION_UNIT_V2 && p[3] == unit)
return p;
while ((hdr = snd_usb_find_desc(state->buffer, state->buflen, hdr,
USB_DT_CS_INTERFACE)) != NULL) {
if (hdr->bLength >= 4 &&
hdr->bDescriptorSubtype >= UAC_INPUT_TERMINAL &&
hdr->bDescriptorSubtype <= UAC2_SAMPLE_RATE_CONVERTER &&
hdr->bUnitID == unit)
return hdr;
}

return NULL;
}


/*
* copy a string with the given id
*/
Expand Down

0 comments on commit f0510f7

Please sign in to comment.