[pulseaudio-commits] 2 commits - src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Fri Dec 13 03:48:30 PST 2013
src/pulsecore/modargs.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 08287011463430d6e4289263b04428b745de1917
Author: Peter Meerwald <p.meerwald at bct-electronic.com>
Date: Wed Dec 11 17:07:04 2013 +0100
modargs: Do not modify alternate_rate in pa_modargs_get_alternate_sample_rate() on failure
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c
index 6855b6a..51e5501 100644
--- a/src/pulsecore/modargs.c
+++ b/src/pulsecore/modargs.c
@@ -411,15 +411,21 @@ int pa_modargs_get_sample_spec(pa_modargs *ma, pa_sample_spec *rss) {
}
int pa_modargs_get_alternate_sample_rate(pa_modargs *ma, uint32_t *alternate_rate) {
- pa_assert(ma);
+ uint32_t rate_local;
+
pa_assert(alternate_rate);
- if ((pa_modargs_get_value_u32(ma, "alternate_rate", alternate_rate)) < 0 ||
- *alternate_rate <= 0 ||
- *alternate_rate > PA_RATE_MAX ||
- !((*alternate_rate % 4000 == 0) || (*alternate_rate % 11025 == 0)))
+ rate_local = *alternate_rate;
+ if ((pa_modargs_get_value_u32(ma, "alternate_rate", &rate_local)) < 0 ||
+ rate_local <= 0 ||
+ rate_local > PA_RATE_MAX)
+ return -1;
+
+ if (!((rate_local % 4000 == 0) || (rate_local % 11025 == 0)))
return -1;
+ *alternate_rate = rate_local;
+
return 0;
}
commit ff06e24eb5e4c00c2b80172dbce0971376fc167f
Author: Peter Meerwald <p.meerwald at bct-electronic.com>
Date: Wed Dec 11 17:07:03 2013 +0100
modargs: Fix pa_modargs_get_sample_rate() if no "rate" is present in the modargs
see http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-December/019471.html
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
Reported-by: "poljar (Damir JeliÄ)" <poljarinho at gmail.com>
diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c
index 432e480..6855b6a 100644
--- a/src/pulsecore/modargs.c
+++ b/src/pulsecore/modargs.c
@@ -369,6 +369,7 @@ int pa_modargs_get_sample_rate(pa_modargs *ma, uint32_t *rate) {
pa_assert(rate);
+ rate_local = *rate;
if ((pa_modargs_get_value_u32(ma, "rate", &rate_local)) < 0 ||
rate_local <= 0 ||
rate_local > PA_RATE_MAX)
More information about the pulseaudio-commits
mailing list