From: Mike Brady Date: Fri, 4 Jan 2019 17:07:21 +0000 (+0000) Subject: Add code for getting and setting the interpolation threshold. X-Git-Tag: 3.3RC0~66^2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0e718c12af37b8ca0018fbeacd6b6d2ef720d2;p=thirdparty%2Fshairport-sync.git Add code for getting and setting the interpolation threshold. --- diff --git a/audio.c b/audio.c index a0b5f74d..4c3df7df 100644 --- 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)) {