summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/artwork/Makefile.am9
-rw-r--r--plugins/artwork/artwork.c13
2 files changed, 19 insertions, 3 deletions
diff --git a/plugins/artwork/Makefile.am b/plugins/artwork/Makefile.am
index 11f98e24..9840b5e1 100644
--- a/plugins/artwork/Makefile.am
+++ b/plugins/artwork/Makefile.am
@@ -2,6 +2,11 @@ if HAVE_ARTWORK
artworkdir = $(libdir)/$(PACKAGE)
pkglib_LTLIBRARIES = artwork.la
+if HAVE_OGG
+ogg_def = -DUSE_OGG=1
+ogg_libs = $(OGG_LIBS)
+endif
+
if ARTWORK_USE_VFS_CURL
artwork_net_cflags = -DUSE_VFS_CURL
artwork_net_sources = albumartorg.c albumartorg.h lastfm.c lastfm.h wos.c wos.h escape.c escape.h
@@ -24,6 +29,6 @@ FLAC_DEPS=$(FLAC_LIBS)
flac_cflags=-DUSE_METAFLAC $(FLAC_CFLAGS)
endif
-AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) -std=c99
-artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS)
+AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) $(ogg_def) -std=c99
+artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS) $(ogg_libs)
endif
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c
index 94717931..a6c27172 100644
--- a/plugins/artwork/artwork.c
+++ b/plugins/artwork/artwork.c
@@ -1166,7 +1166,18 @@ fetcher_thread (void *none)
break;
}
- if(! (is_ogg? FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb) : FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb)) ) {
+ int res = 0;
+ if (is_ogg) {
+#if USE_OGG
+ res = FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb);
+#endif
+ }
+ else
+ {
+ res = FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb);
+ }
+
+ if(!res) {
trace ("artwork: failed to read metadata from flac: %s\n", filename);
deadbeef->fclose (file);
FLAC__metadata_chain_delete(chain);