]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
add option disable synchronization; delay() should return a signed integer, duh.
authorMike Brady <mikebrady@eircom.net>
Sat, 26 Mar 2016 21:35:49 +0000 (21:35 +0000)
committerMike Brady <mikebrady@eircom.net>
Sat, 26 Mar 2016 21:35:49 +0000 (21:35 +0000)
audio_alsa.c

index 647f548891f354d847522d9f84715062ea024359..e29450fc1469ef6b003d2a28473688303f0ff4e1 100644 (file)
@@ -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;