modargs: Add pa_modargs_get_resample_method()

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
Peter Meerwald 2013-08-08 08:19:33 +02:00 committed by Tanu Kaskinen
parent 68156d3f79
commit 22ee1b9d53
2 changed files with 22 additions and 0 deletions

View file

@ -428,6 +428,24 @@ int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map
return 0;
}
int pa_modargs_get_resample_method(pa_modargs *ma, pa_resample_method_t *rmethod) {
const char *m;
pa_assert(ma);
pa_assert(rmethod);
if ((m = pa_modargs_get_value(ma, "resample_method", NULL))) {
pa_resample_method_t method = pa_parse_resample_method(m);
if (method == PA_RESAMPLER_INVALID)
return -1;
*rmethod = method;
}
return 0;
}
int pa_modargs_get_sample_spec_and_channel_map(
pa_modargs *ma,
pa_sample_spec *rss,