[pulseaudio-discuss] [Patch] RAOP: fix audio synchronisation, take two

Tanu Kaskinen tanuk at iki.fi
Mon Sep 18 19:47:29 UTC 2017


On Sun, 2017-09-17 at 20:54 +0200, Colin Leroy wrote:
> On 17 September 2017 at 19h51, Tanu Kaskinen wrote:
> > Why do you check the return value of pa_modargs_get_value() before
> > calling pa_modargs_get_value_u32()? As far as I can tell, that makes
> > no difference.
> 
> pa_modargs_get_value_u32() (and its friends) set the parameter to 0 if
> it's not present, returning -1 only in case of integer conversion error.

No, the function doesn't set the parameter when the argument is not
present.

Since the function returns zero both when a valid value is provided and
when the argument is not set, you need to call pa_modargs_get_value()
in order to know whether to set the latency_set flag or not, so it's
not as useless as I first thought.

If the argument is set, but parsing it fails, you should log an error
message and fail. (Somehow it didn't occur to me to complain about this
earlier.)

-- 
Tanu

https://www.patreon.com/tanuk


More information about the pulseaudio-discuss mailing list