From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 13 Jul 2020 09:47:10 +0000 (+0100) Subject: Ensure metadata and cover art are enabled if metadata support is included at compilat... X-Git-Tag: 3.3.8~16^2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77a5cf1e80c05065b210467752c9b506bee87caf;p=thirdparty%2Fshairport-sync.git Ensure metadata and cover art are enabled if metadata support is included at compilation. Reword some misleading error messages, set convolution defaults even if no configuration file is found. --- diff --git a/dacp.c b/dacp.c index c6b9968f..a5d0d659 100644 --- a/dacp.c +++ b/dacp.c @@ -154,7 +154,7 @@ int dacp_send_command(const char *command, char **body, ssize_t *bodysize) { // debug(1,"dacp_send_command: command is: \"%s\".",command); if (dacp_server.port == 0) { - debug(3, "No DACP port specified yet"); + // debug(3, "No DACP port specified yet"); result = 490; // no port specified } else { @@ -504,11 +504,13 @@ void *dacp_monitor_thread_code(__attribute__((unused)) void *na) { (metadata_store.advanced_dacp_server_active != 0); metadata_store.dacp_server_active = 0; metadata_store.advanced_dacp_server_active = 0; + /* debug(3, "setting metadata_store.dacp_server_active and " "metadata_store.advanced_dacp_server_active to 0 with an update " "flag value of %d", ch); + */ metadata_hub_modify_epilog(ch); uint64_t time_to_wait_for_wakeup_ns = @@ -1249,7 +1251,7 @@ int dacp_get_volume(int32_t *the_actual_volume) { } else { debug(1, "Unexpected return code %d from dacp_get_speaker_list.", http_response); } - } else if (http_response != 400) { + } else if ((http_response != 400) && (http_response != 490)) { debug(3, "Unexpected return code %d from dacp_get_client_volume.", http_response); } if (the_actual_volume) { diff --git a/metadata_hub.c b/metadata_hub.c index 190895c0..7b20ae18 100644 --- a/metadata_hub.c +++ b/metadata_hub.c @@ -148,7 +148,7 @@ void _metadata_hub_modify_prolog(const char *filename, const int linenumber) { } last_metadata_hub_modify_prolog_file = strdup(filename); last_metadata_hub_modify_prolog_line = linenumber; - debug(3, "Metadata_hub write lock acquired."); + // debug(3, "Metadata_hub write lock acquired."); } metadata_hub_re_lock_access_is_delayed = 0; } @@ -169,7 +169,7 @@ void _metadata_hub_modify_epilog(int modified, const char *filename, const int l } } pthread_rwlock_unlock(&metadata_hub_re_lock); - debug(3, "Metadata_hub write lock unlocked."); + // debug(3, "Metadata_hub write lock unlocked."); } /* diff --git a/shairport.c b/shairport.c index 14e50725..975b71fc 100644 --- a/shairport.c +++ b/shairport.c @@ -266,7 +266,7 @@ void usage(char *progname) { printf(" --metadata-pipename=PIPE send metadata to PIPE, e.g. " "--metadata-pipename=/tmp/shairport-sync-metadata.\n"); printf(" The default is /tmp/shairport-sync-metadata.\n"); - printf(" --get-coverart send cover art through the metadata pipe.\n"); + printf(" -g, --get-coverart send cover art through the metadata pipe.\n"); #endif printf(" -u, --use-stderr log messages through STDERR rather than the system log.\n"); printf("\n"); @@ -418,6 +418,17 @@ int parse_options(int argc, char **argv) { // seconds then we can add an offset of 5.17 seconds and still leave a second's worth of buffers // for unexpected circumstances +#ifdef CONFIG_METADATA + /* Get the metadata setting. */ + config.metadata_enabled = 1; // if metadata support is included, then enable it by default + config.get_coverart = 1; // if metadata support is included, then enable it by default +#endif + +#ifdef CONFIG_CONVOLUTION + config.convolution_max_length = 8192; +#endif + config.loudness_reference_volume_db = -20; + #ifdef CONFIG_METADATA_HUB config.cover_art_cache_dir = "/tmp/shairport-sync/.cache/coverart"; config.scan_interval_when_active = @@ -846,7 +857,6 @@ int parse_options(int argc, char **argv) { #ifdef CONFIG_METADATA /* Get the metadata setting. */ - config.metadata_enabled = 1; // if metadata support is included, then enable it by default if (config_lookup_string(config.cfg, "metadata.enabled", &str)) { if (strcasecmp(str, "no") == 0) config.metadata_enabled = 0; @@ -856,7 +866,6 @@ int parse_options(int argc, char **argv) { die("Invalid metadata enabled option choice \"%s\". It should be \"yes\" or \"no\""); } - config.get_coverart = 1; // if metadata support is included, then enable it by default if (config_lookup_string(config.cfg, "metadata.include_cover_art", &str)) { if (strcasecmp(str, "no") == 0) config.get_coverart = 0; @@ -988,7 +997,6 @@ int parse_options(int argc, char **argv) { dvalue); } - config.convolution_max_length = 8192; if (config_lookup_int(config.cfg, "dsp.convolution_max_length", &value)) { config.convolution_max_length = value; @@ -1015,7 +1023,6 @@ int parse_options(int argc, char **argv) { die("Invalid dsp.convolution. It should be \"yes\" or \"no\""); } - config.loudness_reference_volume_db = -20; if (config_lookup_float(config.cfg, "dsp.loudness_reference_volume_db", &dvalue)) { config.loudness_reference_volume_db = dvalue; if (dvalue > 0 || dvalue < -100) @@ -1168,7 +1175,7 @@ int parse_options(int argc, char **argv) { break; case 'g': if (config.metadata_enabled == 0) - die("If you want to get cover art, you must also select the --metadata-pipename option."); + die("If you want to get cover art, ensure metadata_enabled is true."); break; #endif case 'S':