summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-07-11 20:02:59 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-07-11 20:03:21 +0200
commit9f020047defd65528acc27c70a9117508f889ce5 (patch)
treeaae68aeb5e0ed613959488f4c8ce5a121b504190 /plugins
parenteb7285d907eed79e5fc3faa4fbe59f348f502002 (diff)
artwork: fixed path inconsistencies between different functions
Diffstat (limited to 'plugins')
-rw-r--r--plugins/artwork/artwork.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c
index 799cce92..27c3267d 100644
--- a/plugins/artwork/artwork.c
+++ b/plugins/artwork/artwork.c
@@ -139,7 +139,7 @@ esc_char (char c) {
return '_';
}
-int
+static int
make_cache_dir_path (char *path, int size, const char *artist, int img_size) {
char esc_artist[PATH_MAX];
int i;
@@ -174,24 +174,23 @@ make_cache_dir_path (char *path, int size, const char *artist, int img_size) {
return sz;
}
-int
+static int
make_cache_path2 (char *path, int size, const char *fname, const char *album, const char *artist, int img_size) {
- if (!album) {
- album = "";
- }
- if (!artist) {
- artist = "";
- }
+ int unk = 0;
- if (*album && !(*artist)) {
- artist = album;
+ if (!album || !(*album)) {
+ album = "Unknown album";
+ unk = 1;
+ }
+ if (!artist || !(*artist)) {
+ artist = "Unknown artist";
+ unk = 1;
}
- if (!*artist || !*album)
+ if (unk)
{
if (fname) {
- // album=escape(path), artist=uknown
- artist = "Unknown artist";
+ // album=escape(path)
album = fname;
}
else {
@@ -225,12 +224,12 @@ make_cache_path2 (char *path, int size, const char *fname, const char *album, co
}
}
-void
+static void
make_cache_path (char *path, int size, const char *album, const char *artist, int img_size) {
make_cache_path2 (path, size, NULL, album, artist, img_size);
}
-void
+static void
queue_add (const char *fname, const char *artist, const char *album, int img_size, artwork_callback callback, void *user_data) {
if (!artist) {
artist = "";
@@ -274,7 +273,7 @@ queue_add (const char *fname, const char *artist, const char *album, int img_siz
deadbeef->cond_signal (cond);
}
-void
+static void
queue_pop (void) {
deadbeef->mutex_lock (mutex);
cover_query_t *next = queue ? queue->next : NULL;
@@ -481,7 +480,7 @@ jpeg_resize (const char *fname, const char *outname, int scaled_size) {
return 0;
}
-int
+static int
png_resize (const char *fname, const char *outname, int scaled_size) {
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
@@ -861,6 +860,7 @@ copy_file (const char *in, const char *out, int img_size) {
}
static const char *filter_custom_mask = NULL;
+
static int
filter_custom (const struct dirent *f)
{
@@ -1399,7 +1399,7 @@ find_image (const char *path) {
return NULL;
}
-char*
+static char*
get_album_art (const char *fname, const char *artist, const char *album, int size, artwork_callback callback, void *user_data)
{
char path [1024];
@@ -1473,13 +1473,7 @@ get_album_art_sync (const char *fname, const char *artist, const char *album, in
return image_fname;
}
-DB_plugin_t *
-artwork_load (DB_functions_t *api) {
- deadbeef = api;
- return DB_PLUGIN (&plugin);
-}
-
-void
+static void
artwork_reset (int fast) {
if (fast) {
// if (current_file) {
@@ -1693,3 +1687,10 @@ static DB_artwork_plugin_t plugin = {
.make_cache_path = make_cache_path,
.make_cache_path2 = make_cache_path2,
};
+
+DB_plugin_t *
+artwork_load (DB_functions_t *api) {
+ deadbeef = api;
+ return DB_PLUGIN (&plugin);
+}
+