Fix crash when metadata enabled but no metadata pipename given
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.50])
|
||||
AC_INIT([shairport-sync], [2.5.0.4], [mikebrady@eircom.net])
|
||||
AC_INIT([shairport-sync], [2.5.0.5], [mikebrady@eircom.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_SRCDIR([shairport.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
+8
-2
@@ -541,6 +541,13 @@ int parse_options(int argc, char **argv) {
|
||||
if (c < -1) {
|
||||
die("%s: %s", poptBadOption(optCon, POPT_BADOPTION_NOALIAS), poptStrerror(c));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_METADATA
|
||||
if ((config.metadata_enabled == 1) && (config.metadata_pipename == NULL))
|
||||
config.metadata_pipename=strdup("/tmp/shairport-sync-metadata");
|
||||
#endif
|
||||
|
||||
|
||||
if (tdebuglev!=0)
|
||||
debuglev = tdebuglev;
|
||||
return optind + 1;
|
||||
@@ -649,8 +656,7 @@ int main(int argc, char **argv) {
|
||||
gethostname(hostname, 100);
|
||||
config.apname = malloc(20 + 100);
|
||||
snprintf(config.apname, 20 + 100, "Shairport Sync on %s", hostname);
|
||||
set_requested_connection_state_to_output(
|
||||
1); // we expect to be able to connect to the output device
|
||||
set_requested_connection_state_to_output(1); // we expect to be able to connect to the output device
|
||||
config.audio_backend_buffer_desired_length = 6615; // 0.15 seconds.
|
||||
config.udp_port_base = 6001;
|
||||
config.udp_port_range = 100;
|
||||
|
||||
Reference in New Issue
Block a user