]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix build without metadata support 314/head
authorJörg Krause <joerg.krause@embedded.rocks>
Mon, 23 May 2016 19:58:18 +0000 (21:58 +0200)
committerJörg Krause <joerg.krause@embedded.rocks>
Mon, 23 May 2016 20:01:46 +0000 (22:01 +0200)
Commit f36352dc4ece27fda24ef736183b8ff5729b8c96 introduced the parameter
pipe_timeout for the metadata config. If shairport-sync is now configured
without metadata support, the build fails with:

```
shairport.c: In function ‘main’:
shairport.c:766:9: error: ‘shairport_cfg {aka struct <anonymous>}’ has no member named ‘metadata_pipe_timeout’
   config.metadata_pipe_timeout = 5000; //milliseconds

```

Fix this by opting-out the affected code with CONFIG_METADATA.

common.c
shairport.c

index b4d9583975884f5119932c8584bee464ad508c32..8a200d325802f64f247829e061cd31dad4f4d67f 100644 (file)
--- a/common.c
+++ b/common.c
@@ -513,6 +513,7 @@ 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;
@@ -547,6 +548,7 @@ 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 */
 
index 8c80bfecbfe5822567508a6d8e64018919a81bbc..58c1dc546e3b23e002b281f686d82c0e8149fdf8 100644 (file)
@@ -763,7 +763,9 @@ 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;