modules: Make use of new function pa_modargs_get_sample_rate()

by using pa_modargs_get_sample_rate() we avoid inconsistant validity
checking of the sample rate in various places

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2013-11-29 15:32:41 +01:00 committed by Tanu Kaskinen
parent 742b93d32c
commit e74d4244a2
3 changed files with 3 additions and 6 deletions

View file

@ -213,7 +213,7 @@ int pa__init(pa_module*m) {
ss.channels = 1;
ss.rate = 44100;
if (pa_modargs_get_value_u32(ma, "rate", &ss.rate) < 0 || ss.rate <= 1) {
if (pa_modargs_get_sample_rate(ma, &ss.rate) < 0) {
pa_log("Invalid rate specification");
goto fail;
}