[pulseaudio-discuss] [PATCH 5/5] pactl: Add set-latency-offset command.

Tanu Kaskinen tanuk at iki.fi
Thu Jun 28 03:40:11 PDT 2012


On Fri, 2012-06-22 at 20:55 +0200, poljar (Damir Jelic) wrote:
> @@ -1812,6 +1822,19 @@ int main(int argc, char *argv[]) {
>              action = SET_SINK_FORMATS;
>              formats = pa_xstrdup(argv[optind+2]);
>  
> +        } else if (pa_streq(argv[optind], "set-port-latency-offset")) {
> +            action = SET_PORT_LATENCY_OFFSET;
> +
> +            if (argc != optind+4) {
> +                pa_log(_("You have to specify a card name/index, a port name and a latency offset"));
> +                goto quit;
> +            }
> +
> +            card_name = pa_xstrdup(argv[optind+1]);
> +            port_name = pa_xstrdup(argv[optind+2]);
> +            if (pa_atod(argv[optind + 3], &latency_offset) < 0)
> +                latency_offset = 0;

Please treat parsing failures as a fatal errors instead of silently
using zero as the fallback. And parse the user input as an integer.

-- 
Tanu



More information about the pulseaudio-discuss mailing list