From: Mike Brady Date: Tue, 13 Sep 2016 11:19:28 +0000 (+0100) Subject: Fix error checking of alsa latency and buffer legth settings. X-Git-Tag: 3.0.d18~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43788faa964ad6037029538ececaab3c4a6fe769;p=thirdparty%2Fshairport-sync.git Fix error checking of alsa latency and buffer legth settings. --- diff --git a/audio_alsa.c b/audio_alsa.c index ca5a1e2f..04f74370 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -148,7 +148,7 @@ static int init(int argc, char **argv) { if (config.cfg != NULL) { /* Get the desired buffer size setting. */ if (config_lookup_float(config.cfg, "alsa.audio_backend_buffer_desired_length", &dvalue)) { - if ((dvalue < 0) || (value > 1.5)) + if ((dvalue < 0) || (dvalue > 1.5)) die("Invalid alsa audio backend buffer desired length \"%f\". It " "should be between 0 and " "1.5, default is 0.15 seconds", @@ -160,7 +160,7 @@ static int init(int argc, char **argv) { /* Get the latency offset. */ if (config_lookup_float(config.cfg, "alsa.audio_backend_latency_offset", &dvalue)) { - if ((dvalue < -1.0) || (value > 1.5)) + if ((dvalue < -1.0) || (dvalue > 1.5)) die("Invalid alsa audio backend buffer latency offset \"%f\". It " "should be between -1.0 and +1.5, default is 0 seconds", dvalue);