Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157063
b: refs/heads/master
c: b1ddaf6
h: refs/heads/master
i:
  157061: 3250327
  157059: 93dcba9
  157055: 2093ba6
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Aug 25, 2009
1 parent b18ac9d commit 5ed5fbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 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: edd1365e90eb32625041d09de427d7b03461bc5c
refs/heads/master: b1ddaf681e362ed453182ddee1699d7487069a16
39 changes: 8 additions & 31 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,47 +909,24 @@ static int snd_interval_ratden(struct snd_interval *i,
int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask)
{
unsigned int k;
int changed = 0;
struct snd_interval list_range;

if (!count) {
i->empty = 1;
return -EINVAL;
}
snd_interval_any(&list_range);
list_range.min = UINT_MAX;
list_range.max = 0;
for (k = 0; k < count; k++) {
if (mask && !(mask & (1 << k)))
continue;
if (i->min == list[k] && !i->openmin)
goto _l1;
if (i->min < list[k]) {
i->min = list[k];
i->openmin = 0;
changed = 1;
goto _l1;
}
}
i->empty = 1;
return -EINVAL;
_l1:
for (k = count; k-- > 0;) {
if (mask && !(mask & (1 << k)))
if (!snd_interval_test(i, list[k]))
continue;
if (i->max == list[k] && !i->openmax)
goto _l2;
if (i->max > list[k]) {
i->max = list[k];
i->openmax = 0;
changed = 1;
goto _l2;
}
list_range.min = min(list_range.min, list[k]);
list_range.max = max(list_range.max, list[k]);
}
i->empty = 1;
return -EINVAL;
_l2:
if (snd_interval_checkempty(i)) {
i->empty = 1;
return -EINVAL;
}
return changed;
return snd_interval_refine(i, &list_range);
}

EXPORT_SYMBOL(snd_interval_list);
Expand Down

0 comments on commit 5ed5fbb

Please sign in to comment.