[pulseaudio-discuss] [PATCH 2/6] modargs: Add pa_modargs_get_sample_rate()
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Tue Oct 29 18:33:20 CET 2013
On Thu, 2013-08-08 at 08:19 +0200, Peter Meerwald wrote:
> return sample rate from the "rate" module argument
>
> Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
> ---
> src/pulsecore/modargs.c | 11 +++++++++++
> src/pulsecore/modargs.h | 3 +++
> 2 files changed, 14 insertions(+)
>
> diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c
> index 7133906..65bc669 100644
> --- a/src/pulsecore/modargs.c
> +++ b/src/pulsecore/modargs.c
> @@ -364,6 +364,17 @@ int pa_modargs_get_value_volume(pa_modargs *ma, const char *key, pa_volume_t *va
> return 0;
> }
>
> +int pa_modargs_get_sample_rate(pa_modargs *ma, uint32_t *rate) {
> + pa_assert(rate);
> +
> + if ((pa_modargs_get_value_u32(ma, "rate", rate)) < 0 ||
I think the return value should be modified only on success, so we
should use a local variable to hold the return value from
pa_modargs_get_value_u32(). I'll do this change myself.
--
Tanu
More information about the pulseaudio-discuss
mailing list