From 1b7e23c093b6159b1f05a91e80a7c9ae4a216012 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 25 Mar 2020 10:40:05 +0000 Subject: [PATCH] Add ability to set the missing DACP port scan interval. --- scripts/shairport-sync.conf | 2 +- shairport.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/shairport-sync.conf b/scripts/shairport-sync.conf index 9c875156..170fafc2 100644 --- a/scripts/shairport-sync.conf +++ b/scripts/shairport-sync.conf @@ -54,7 +54,7 @@ general = // resend_control_first_check_time = 0.10; // Use this optional advanced setting to set the wait time in seconds before deciding a packet is missing. // resend_control_check_interval_time = 0.25; // Use this optional advanced setting to set the time in seconds between requests for a missing packet. // resend_control_last_check_time = 0.10; // Use this optional advanced setting to set the latest time, in seconds, by which the last check should be done before the estimated time of a missing packet's transfer to the output buffer. -// +// missing_port_dacp_scan_interval_seconds = 2.0; // Use this optional advanced setting to set the time interval between scans for a DACP port number if no port number has been provided by the player for remote control commands }; // Advanced parameters for controlling how Shairport Sync stays active and how it runs a session diff --git a/shairport.c b/shairport.c index 8f80ebdb..ec5a259a 100644 --- a/shairport.c +++ b/shairport.c @@ -806,6 +806,18 @@ int parse_options(int argc, char **argv) { dvalue, config.resend_control_last_check_time); } + if (config_lookup_float(config.cfg, "general.missing_port_dacp_scan_interval_seconds", + &dvalue)) { + if ((dvalue >= 0.0) && (dvalue <= 300.0)) + config.missing_port_dacp_scan_interval_seconds = dvalue; + else + warn("Invalid general missing_port_dacp_scan_interval_seconds setting \"%d\". It should " + "be " + "between 0.0 and 300.0, " + "inclusive. The setting remains at %f seconds.", + dvalue, config.missing_port_dacp_scan_interval_seconds); + } + /* Get the default latency. Deprecated! */ if (config_lookup_int(config.cfg, "latencies.default", &value)) config.userSuppliedLatency = value;