diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-28 12:41:26 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-28 12:43:41 +0200 |
commit | db7caf339aff51556300c5b36a6e332c1d5c4567 (patch) | |
tree | 3d46bc5ecc97ed1a29d1cdd851546afe6fe931c1 /plugins | |
parent | 25143bec0d6bdfe5575223e8839663719c0dd426 (diff) |
artwork: added libogg checks / linking
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/artwork/Makefile.am | 9 | ||||
-rw-r--r-- | plugins/artwork/artwork.c | 13 |
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); |