]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Brown bag update. Fix compilation errors when neither mpris nor dbus is selected.
authorMike Brady <mikebrady@eircom.net>
Wed, 17 Jan 2018 10:32:31 +0000 (10:32 +0000)
committerMike Brady <mikebrady@eircom.net>
Wed, 17 Jan 2018 10:32:31 +0000 (10:32 +0000)
common.c
shairport.c

index 29cded7f401f3b0bd95610b075a4028651ed5304..026ef50ceebb9d01f03dea75001a344159ee8d9c 100644 (file)
--- a/common.c
+++ b/common.c
@@ -144,22 +144,6 @@ void inform(const char *format, ...) {
   daemon_log(LOG_INFO, "%s", s);
 }
 
-#ifdef HAVE_LIBMBEDTLS
-char *base64_enc(uint8_t *input, int length) {
-  char *buf = NULL;
-  size_t dlen = 0;
-  int rc = mbedtls_base64_encode(NULL, 0, &dlen, input, length);
-  if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
-    debug(1, "Error %d getting length of base64 encode.", rc);
-  else {
-    buf = (char *)malloc(dlen);
-    rc = mbedtls_base64_encode((unsigned char *)buf, dlen, &dlen, input, length);
-    if (rc != 0)
-      debug(1, "Error %d encoding base64.", rc);
-  }
-  return buf;
-}
-
 // The following two functions are adapted slightly and with thanks from Jonathan Leffler's sample
 // code at
 // https://stackoverflow.com/questions/675039/how-can-i-create-directory-tree-in-c-linux
@@ -208,6 +192,22 @@ int mkpath(const char *path, mode_t mode) {
   return (status);
 }
 
+#ifdef HAVE_LIBMBEDTLS
+char *base64_enc(uint8_t *input, int length) {
+  char *buf = NULL;
+  size_t dlen = 0;
+  int rc = mbedtls_base64_encode(NULL, 0, &dlen, input, length);
+  if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
+    debug(1, "Error %d getting length of base64 encode.", rc);
+  else {
+    buf = (char *)malloc(dlen);
+    rc = mbedtls_base64_encode((unsigned char *)buf, dlen, &dlen, input, length);
+    if (rc != 0)
+      debug(1, "Error %d encoding base64.", rc);
+  }
+  return buf;
+}
+
 uint8_t *base64_dec(char *input, int *outlen) {
   // slight problem here is that Apple cut the padding off their challenges. We must restore it
   // before passing it in to the decoder, it seems
index e4b58f6f958b9c5800869621d8e21a663cfec5e3..5de5f9402450f60e608936cb4befaf7b074e9042 100644 (file)
@@ -390,7 +390,9 @@ int parse_options(int argc, char **argv) {
   config.airplay_volume = -18.0; // if no volume is ever set, default to initial default value if
                                  // nothing else comes in first.
   config.fixedLatencyOffset = 11025; // this sounds like it works properly.
+#ifdef HAVE_METADATA_HUB
   config.cover_art_cache_dir = "/tmp/shairport-sync/.cache/coverart";
+#endif
 
   config_setting_t *setting;
   const char *str = 0;