From: Mike Brady Date: Sat, 26 Mar 2016 21:35:49 +0000 (+0000) Subject: add option disable synchronization; delay() should return a signed integer, duh. X-Git-Tag: 2.9.5.2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=953ee31349f33564a2a95622f8e6637eb7203a42;p=thirdparty%2Fshairport-sync.git add option disable synchronization; delay() should return a signed integer, duh. --- diff --git a/audio_alsa.c b/audio_alsa.c index 647f5488..e29450fc 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -42,7 +42,7 @@ static void start(int sample_rate); static void play(short buf[], int samples); static void stop(void); static void flush(void); -static uint32_t delay(void); +static int32_t delay(void); static void volume(double vol); static void linear_volume(double vol); static void parameters(audio_parameters *info); @@ -182,8 +182,19 @@ static int init(int argc, char **argv) { alsa_mix_ctrl = (char *)str; hardware_mixer = 1; } + + /* Get the Daemonize setting. */ + if (config_lookup_string(config.cfg, "alsa.disable_synchronization", &str)) { + if (strcasecmp(str, "no") == 0) + config.no_sync = 0; + else if (strcasecmp(str, "yes") == 0) + config.no_sync = 1; + else + die("Invalid disable_synchronization option choice \"%s\". It should be \"yes\" or \"no\""); + } } + optind = 1; // optind=0 is equivalent to optind=1 plus special behaviour argv--; // so we shift the arguments to satisfy getopt() argc++; @@ -402,7 +413,7 @@ static void start(int sample_rate) { desired_sample_rate = sample_rate; // must be a variable } -static uint32_t delay() { +static int32_t delay() { // debug(3,"audio_alsa delay called."); if (alsa_handle == NULL) { return 0;