Brown bag update. Fix compilation errors when neither mpris nor dbus is selected.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user