]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add code for getting and setting the interpolation threshold.
authorMike Brady <mikebrady@eircom.net>
Fri, 4 Jan 2019 17:07:21 +0000 (17:07 +0000)
committerMike Brady <mikebrady@eircom.net>
Fri, 4 Jan 2019 17:07:21 +0000 (17:07 +0000)
audio.c

diff --git a/audio.c b/audio.c
index a0b5f74d8c08efb2225a99b40eb4295527920ce9..4c3df7dff173ff76b92440ea38f9cd841691cd77 100644 (file)
--- a/audio.c
+++ b/audio.c
@@ -152,6 +152,19 @@ void parse_general_audio_options(void) {
         config.audio_backend_buffer_desired_length = dvalue;
       }
     }
+    
+    /* Get the minumum buffer size for fancy interpolation setting in seconds. */
+    if (config_lookup_float(config.cfg, "general.audio_backend_buffer_interpolation_threshold_in_seconds",
+                            &dvalue)) {
+      if ((dvalue < 0) || (dvalue > config.audio_backend_buffer_desired_length)) {
+        die("Invalid audio_backend_buffer_interpolation_threshold_in_seconds value: \"%f\". It "
+            "should be between 0 and "
+            "audio_backend_buffer_desired_length_in_seconds of %.3f, default is %.3f seconds",
+            dvalue, config.audio_backend_buffer_desired_length,config.audio_backend_buffer_interpolation_threshold_in_seconds);
+      } else {
+        config.audio_backend_buffer_interpolation_threshold_in_seconds = dvalue;
+      }
+    }
 
     /* Get the latency offset (deprecated). */
     if (config_lookup_int(config.cfg, "general.audio_backend_latency_offset", &value)) {