From: Mike Brady Date: Sun, 26 Jun 2016 14:20:09 +0000 (+0100) Subject: Remove variable delay from non_blocking_write and include it whether metadata is... X-Git-Tag: 2.8.4.2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fe705cf5f2e32c48c6cc41dd74e0d4e3f3c8591;p=thirdparty%2Fshairport-sync.git Remove variable delay from non_blocking_write and include it whether metadata is enabled or not. Remove the INSTALL file and ignroe it in git. --- diff --git a/.gitignore b/.gitignore index 87e9f1ef..9e055931 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/INSTALL /shairport-sync /shairport-sync.exe /*.o diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 55a5707f..00000000 --- a/INSTALL +++ /dev/null @@ -1,4 +0,0 @@ -Installation Instructions -************************* - -Please refer to README.md for installation instructions. diff --git a/common.c b/common.c index 0dc8a0b7..bf721273 100644 --- a/common.c +++ b/common.c @@ -513,7 +513,6 @@ uint64_t get_absolute_time_in_fp() { return time_now_fp; } -#ifdef CONFIG_METADATA ssize_t non_blocking_write(int fd, const void *buf, size_t count) { void *ibuf = (void *)buf; size_t bytes_remaining = count; @@ -523,7 +522,7 @@ ssize_t non_blocking_write(int fd, const void *buf, size_t count) { // check that we can do some writing ufds[0].fd = fd; ufds[0].events = POLLOUT; - rc = poll(ufds, 1, config.metadata_pipe_timeout); + rc = poll(ufds, 1, 5000); if (rc < 0) { // debug(1, "non-blocking write error waiting for pipe to become ready for writing..."); } else if (rc == 0) { @@ -546,7 +545,6 @@ ssize_t non_blocking_write(int fd, const void *buf, size_t count) { return rc; // return write(fd,buf,count); } -#endif /* from http://coding.debuntu.org/c-implementing-str_replace-replace-all-occurrences-substring#comment-722 */ diff --git a/common.h b/common.h index 5924be79..a67f95b4 100644 --- a/common.h +++ b/common.h @@ -54,7 +54,6 @@ typedef struct { char *service_name; // the name for the shairport service, e.g. "Shairport Sync Version %v running on host %h" #ifdef CONFIG_METADATA int metadata_enabled; - int metadata_pipe_timeout; // in milliseconds char *metadata_pipename; char *metadata_sockaddr; int metadata_sockport; diff --git a/configure.ac b/configure.ac index c08c4574..5ce74af8 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -AC_INIT([shairport-sync], [2.8.4.1], [mikebrady@eircom.net]) +AC_INIT([shairport-sync], [2.8.4.2], [mikebrady@eircom.net]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/rtsp.c b/rtsp.c index e78456f7..cf94c52d 100644 --- a/rtsp.c +++ b/rtsp.c @@ -1838,7 +1838,6 @@ void rtsp_listen_loop(void) { // strerror(errno)); continue; } - ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)); #ifdef IPV6_V6ONLY diff --git a/shairport.c b/shairport.c index 58c1dc54..df577348 100644 --- a/shairport.c +++ b/shairport.c @@ -490,14 +490,6 @@ int parse_options(int argc, char **argv) { if (config_lookup_int(config.cfg, "metadata.socket_msglength", &value)) { config.metadata_sockmsglength = value < 500 ? 500 : value > 65000 ? 65000 : value; } - if (config_lookup_int(config.cfg, "metadata.pipe_timeout", &value)) { - - if ((value < 1) || (value > 150000)) - die("Invalid timeout range \"%sd\". It should be in the range 1 to 150,000 milliseconds.", - value); - else - config.metadata_pipe_timeout = value; - } #endif @@ -763,9 +755,6 @@ int main(int argc, char **argv) { //snprintf(config.service_name, 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 config.audio_backend_buffer_desired_length = 6615; // 0.15 seconds. -#ifdef CONFIG_METADATA - config.metadata_pipe_timeout = 5000; //milliseconds -#endif config.udp_port_base = 6001; config.udp_port_range = 100;