From 5104e0d882f02dbb06da0cba6094a89514696980 Mon Sep 17 00:00:00 2001 From: waker Date: Fri, 4 May 2012 19:10:18 +0200 Subject: new "default cover" picture by thesame --- plugins/artwork/artwork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/artwork/artwork.c') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 47aaf748..161448c3 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1334,7 +1334,7 @@ artwork_plugin_start (void) const char *def_art = deadbeef->conf_get_str_fast ("gtkui.nocover_pixmap", NULL); if (!def_art) { - snprintf (default_cover, sizeof (default_cover), "%s/noartwork.jpg", deadbeef->get_pixmap_dir ()); + snprintf (default_cover, sizeof (default_cover), "%s/noartwork.png", deadbeef->get_pixmap_dir ()); } else { strcpy (default_cover, def_art); -- cgit v1.2.3 From 64f0d57bed8da14c0dcc0f1045c91af536d69ee0 Mon Sep 17 00:00:00 2001 From: waker Date: Sat, 12 May 2012 10:38:43 +0200 Subject: artwork: PATH_MAX fix for bsd systems --- configure.ac | 2 ++ plugins/artwork/artwork.c | 3 +++ 2 files changed, 5 insertions(+) (limited to 'plugins/artwork/artwork.c') diff --git a/configure.ac b/configure.ac index 9489862e..14cd5e18 100644 --- a/configure.ac +++ b/configure.ac @@ -126,6 +126,8 @@ dnl check libsocket (OpenIndiana) AC_CHECK_LIB([socket], [main], [HAVE_SOCKET=yes;DL_LIBS="-lsocket";AC_SUBST(DL_LIBS)]) dnl check for seperate alloca.h (OpenIndiana) AC_CHECK_HEADER([alloca.h],[],[alloca.h not found.]) +dnl check for syslimits.h (BSD) +AC_CHECK_HEADERS([sys/syslimits.h]) if test "x$enable_portable" != "xno" && test "x$enable_staticlink" != "xno" ; then AC_DEFINE_UNQUOTED([PORTABLE], [1], [Define if building portable version]) diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 161448c3..2bac1826 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -10,6 +10,9 @@ #include #include #include +#if HAVE_SYS_SYSLIMITS_H +#include +#endif #include "../../deadbeef.h" #include "artwork.h" #include "lastfm.h" -- cgit v1.2.3 From f4f70d6a0e9158b28add0260a337344d8126213d Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 13 May 2012 09:20:16 +0200 Subject: fixed flac embedded covers loading --- plugins/artwork/artwork.c | 114 ++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 60 deletions(-) (limited to 'plugins/artwork/artwork.c') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 2bac1826..aa941b81 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -979,72 +979,66 @@ fetcher_thread (void *none) #ifdef USE_METAFLAC // try to load embedded from flac metadata { - FLAC__StreamMetadata *meta = NULL; - do { - trace ("trying to load artwork flac metadata for %s\n", param->fname); - - if (!FLAC__metadata_get_picture ( - param->fname, // filename - &meta, // picture - FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER, // type - NULL, // mime_type - NULL, // description - (unsigned)(-1), // max_width - (unsigned)(-1), // max_height - (unsigned)(-1), // max_depth - (unsigned)(-1) // max_colors - )){ - trace ("%s don't have an embedded cover\n",param->fname); - - if (!FLAC__metadata_get_picture ( - param->fname, // filename - &meta, // picture - -1, // type - NULL, // mime_type - NULL, // description - (unsigned)(-1), // max_width - (unsigned)(-1), // max_height - (unsigned)(-1), // max_depth - (unsigned)(-1) // max_colors - )){ - trace ("%s don't have an embedded album art\n",param->fname); - break; - } + const char *filename = param->fname; + FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new(); + int is_ogg = 0; + if(strlen(filename) >= 4 && (0 == strcmp(filename+strlen(filename)-4, ".oga") || 0 == strcasecmp(filename+strlen(filename)-4, ".ogg"))) { + is_ogg = 1; + } - } - FLAC__StreamMetadata_Picture *pic = &meta->data.picture; + if(! (is_ogg? FLAC__metadata_chain_read_ogg(chain, filename) : FLAC__metadata_chain_read(chain, filename)) ) { + trace ("%s: ERROR: reading metadata", filename); + FLAC__metadata_chain_delete(chain); + break; + } + FLAC__StreamMetadata *picture = 0; + FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); + FLAC__metadata_iterator_init(iterator, chain); - trace ("found flac cover art of %d bytes (%s)\n", pic->data_length, pic->description); - char tmp_path[1024]; - char cache_path[1024]; - make_cache_path (cache_path, sizeof (cache_path), param->album, param->artist, -1); - trace ("will write flac cover art into %s\n", cache_path); - snprintf (tmp_path, sizeof (tmp_path), "%s.part", cache_path); - FILE *out = fopen (tmp_path, "w+b"); - if (!out) { - trace ("artwork: failed to open %s for writing\n", tmp_path); - break; - } - if (fwrite (pic->data, 1, pic->data_length, out) != pic->data_length) { - trace ("artwork: failed to write flac picture into %s\n", tmp_path); - fclose (out); - unlink (tmp_path); - break; + do { + FLAC__StreamMetadata *block = FLAC__metadata_iterator_get_block(iterator); + if(block->type == FLAC__METADATA_TYPE_PICTURE) { + picture = block; } + } while(FLAC__metadata_iterator_next(iterator) && 0 == picture); + + if (!picture) { + trace ("%s doesn't have an embedded cover\n", param->fname); + break; + } + FLAC__StreamMetadata_Picture *pic = &picture->data.picture; + trace ("found flac cover art of %d bytes (%s)\n", pic->data_length, pic->description); + char tmp_path[1024]; + char cache_path[1024]; + make_cache_path (cache_path, sizeof (cache_path), param->album, param->artist, -1); + trace ("will write flac cover art into %s\n", cache_path); + snprintf (tmp_path, sizeof (tmp_path), "%s.part", cache_path); + FILE *out = fopen (tmp_path, "w+b"); + if (!out) { + trace ("artwork: failed to open %s for writing\n", tmp_path); + break; + } + if (fwrite (pic->data, 1, pic->data_length, out) != pic->data_length) { + trace ("artwork: failed to write flac picture into %s\n", tmp_path); fclose (out); - int err = rename (tmp_path, cache_path); - if (err != 0) { - trace ("Failed not move %s to %s: %s\n", tmp_path, cache_path, strerror (err)); - unlink (tmp_path); - break; - } unlink (tmp_path); - got_pic = 1; - } while (0); + break; + } + fclose (out); + int err = rename (tmp_path, cache_path); + if (err != 0) { + trace ("Failed not move %s to %s: %s\n", tmp_path, cache_path, strerror (err)); + unlink (tmp_path); + break; + } + unlink (tmp_path); + got_pic = 1; - if (meta != NULL) { - trace ("release flac metadata block\n"); - FLAC__metadata_object_delete (meta); + if (chain) { + FLAC__metadata_chain_delete(chain); + } + if (iterator) { + FLAC__metadata_iterator_delete(iterator); } } #endif -- cgit v1.2.3 From c0fe4bc6e4d2c27320481e4645b60722080aa8fd Mon Sep 17 00:00:00 2001 From: waker Date: Sat, 19 May 2012 11:02:33 +0200 Subject: fixed album art load regression --- plugins/artwork/artwork.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/artwork/artwork.c') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index aa941b81..6ba07522 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -978,6 +978,7 @@ fetcher_thread (void *none) #ifdef USE_METAFLAC // try to load embedded from flac metadata + for (;;) { const char *filename = param->fname; FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new(); @@ -1040,6 +1041,7 @@ fetcher_thread (void *none) if (iterator) { FLAC__metadata_iterator_delete(iterator); } + break; } #endif } -- cgit v1.2.3 From 6ddc4875cb7e7cf5f98e1fc550e5c9fe2295cfee Mon Sep 17 00:00:00 2001 From: waker Date: Mon, 21 May 2012 22:16:27 +0200 Subject: bsd sys/syslimits.h fix --- plugins/artwork/artwork.c | 2 +- plugins/cdda/cdda.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins/artwork/artwork.c') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 6ba07522..8f60455d 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1,5 +1,5 @@ #ifdef HAVE_CONFIG_H -# include +# include "../../config.h" #endif #include #include diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c index 0705ad84..9813b2a5 100644 --- a/plugins/cdda/cdda.c +++ b/plugins/cdda/cdda.c @@ -18,11 +18,17 @@ /* screwed/maintained by Alexey Yakovenko */ +#ifdef HAVE_CONFIG_H +# include "../../config.h" +#endif #include #include #include #include #include +#if HAVE_SYS_SYSLIMITS_H +#include +#endif #include #include -- cgit v1.2.3 From 194a40f4c5f2b7514461be7729734c3204d86e90 Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 30 May 2012 23:19:36 +0200 Subject: added sys/cdefs.h include before sys/syslimits.h --- conf.c | 3 +++ configure.ac | 1 + plugins/artwork/artwork.c | 3 +++ plugins/cdda/cdda.c | 3 +++ plugins/converter/converter.c | 3 +++ plugins/converter/convgui.c | 3 +++ 6 files changed, 16 insertions(+) (limited to 'plugins/artwork/artwork.c') diff --git a/conf.c b/conf.c index eff15de5..9b2a75da 100644 --- a/conf.c +++ b/conf.c @@ -25,6 +25,9 @@ #include #include #include +#if HAVE_SYS_CDEFS_H +#include +#endif #if HAVE_SYS_SYSLIMITS_H #include #endif diff --git a/configure.ac b/configure.ac index 781b0a7c..57914b28 100644 --- a/configure.ac +++ b/configure.ac @@ -131,6 +131,7 @@ dnl check for seperate alloca.h (OpenIndiana) AC_CHECK_HEADER([alloca.h],[],[alloca.h not found.]) dnl check for syslimits.h (BSD) AC_CHECK_HEADERS([sys/syslimits.h]) +AC_CHECK_HEADERS([sys/cdefs.h]) if test "x$enable_portable" != "xno" && test "x$enable_staticlink" != "xno" ; then AC_DEFINE_UNQUOTED([PORTABLE], [1], [Define if building portable version]) diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 8f60455d..54f1f34a 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -10,6 +10,9 @@ #include #include #include +#if HAVE_SYS_CDEFS_H +#include +#endif #if HAVE_SYS_SYSLIMITS_H #include #endif diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c index 9813b2a5..d970e4fe 100644 --- a/plugins/cdda/cdda.c +++ b/plugins/cdda/cdda.c @@ -26,6 +26,9 @@ #include #include #include +#if HAVE_SYS_CDEFS_H +#include +#endif #if HAVE_SYS_SYSLIMITS_H #include #endif diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c index 956e4586..72a5ddf5 100644 --- a/plugins/converter/converter.c +++ b/plugins/converter/converter.c @@ -19,6 +19,9 @@ #ifdef HAVE_CONFIG_H # include "../../config.h" #endif +#if HAVE_SYS_CDEFS_H +#include +#endif #if HAVE_SYS_SYSLIMITS_H #include #endif diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c index 712c6f24..9c65fb9c 100644 --- a/plugins/converter/convgui.c +++ b/plugins/converter/convgui.c @@ -19,6 +19,9 @@ #ifdef HAVE_CONFIG_H # include "../../config.h" #endif +#if HAVE_SYS_CDEFS_H +#include +#endif #if HAVE_SYS_SYSLIMITS_H #include #endif -- cgit v1.2.3 From 62155250836609cc7896953b25ac300c17fbd7de Mon Sep 17 00:00:00 2001 From: waker Date: Thu, 6 Sep 2012 20:25:51 +0200 Subject: fixed album art search order (now it's alphabetical) --- plugins/artwork/artwork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/artwork/artwork.c') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index 54f1f34a..7ba418fc 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1080,7 +1080,7 @@ fetcher_thread (void *none) p = e; } if (files_count == 0) { - files_count = scandir (path, &files, filter_jpg, NULL); + files_count = scandir (path, &files, filter_jpg, alphasort); } if (files_count > 0) { -- cgit v1.2.3