add new API call pa_cvolume_compatible()

This commit is contained in:
Lennart Poettering 2008-10-03 17:43:40 +02:00
parent 619ed8a82d
commit ebb2ecbe12
3 changed files with 19 additions and 0 deletions

View file

@ -325,3 +325,17 @@ pa_cvolume *pa_cvolume_remap(pa_cvolume *v, pa_channel_map *from, pa_channel_map
*v = result;
return v;
}
int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) {
pa_assert(v);
pa_assert(ss);
if (!pa_cvolume_valid(v))
return 0;
if (!pa_sample_spec_valid(ss))
return 0;
return v->channels == ss->channels;
}