mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
export pa_channel_map_superset()
This commit is contained in:
parent
7368a6e6be
commit
04e9214065
4 changed files with 24 additions and 20 deletions
|
|
@ -577,3 +577,22 @@ int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *s
|
|||
|
||||
return map->channels == ss->channels;
|
||||
}
|
||||
|
||||
int pa_channel_map_superset(const pa_channel_map *a, const pa_channel_map *b) {
|
||||
pa_bool_t in_a[PA_CHANNEL_POSITION_MAX];
|
||||
unsigned i;
|
||||
|
||||
pa_assert(a);
|
||||
pa_assert(b);
|
||||
|
||||
memset(in_a, 0, sizeof(in_a));
|
||||
|
||||
for (i = 0; i < a->channels; i++)
|
||||
in_a[a->map[i]] = TRUE;
|
||||
|
||||
for (i = 0; i < b->channels; i++)
|
||||
if (!in_a[b->map[i]])
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue