diff options
Diffstat (limited to 'mpd-notification.c')
-rw-r--r-- | mpd-notification.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mpd-notification.c b/mpd-notification.c index 764df95..e79bc68 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -56,6 +56,7 @@ void received_signal(int signal) { } } +#ifdef HAVE_LIBAV /*** retrieve_album_art ***/ char * retrieve_album_art(const char *path) { int i, ret = 0; @@ -105,14 +106,18 @@ fail: return NULL; } } +#endif /*** get_icon ***/ char * get_icon(const char * music_dir, const char * uri) { - char * icon = NULL, * uri_path = NULL, * uri_dirname = NULL; + char * icon = NULL, * uri_dirname = NULL; DIR * dir; struct dirent * entry; regex_t regex; +#ifdef HAVE_LIBAV + char * uri_path = NULL; + /* try album artwork first */ uri_path = malloc(strlen(music_dir) + strlen(uri) + 2); sprintf(uri_path, "%s/%s", music_dir, uri); @@ -120,6 +125,7 @@ char * get_icon(const char * music_dir, const char * uri) { if (icon != NULL) goto found; +#endif uri_dirname = strdup(uri); @@ -153,9 +159,12 @@ char * get_icon(const char * music_dir, const char * uri) { regfree(®ex); closedir(dir); +#ifdef HAVE_LIBAV found: if (uri_path) free(uri_path); +#endif + if (uri_dirname) free(uri_dirname); @@ -243,8 +252,10 @@ int main(int argc, char ** argv) { } } +#ifdef HAVE_LIBAV /* libav */ av_register_all(); +#endif conn = mpd_connection_new(mpd_host, mpd_port, mpd_timeout); |