diff options
author | waker <wakeroid@gmail.com> | 2012-10-28 15:25:26 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-10-28 15:25:26 +0100 |
commit | 173c558fc4f18772b372b07c55d4ea07e252131b (patch) | |
tree | 766684deed3d814eb831b086b2a6659c5fff5c92 /plugins | |
parent | 79aec07b7d75314c84f665a2b768267606ca34c0 (diff) |
fixed cover loader bug which leads to infinite request chain when the image file can't be loaded
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/artwork/artwork.c | 2 | ||||
-rw-r--r-- | plugins/gtkui/coverart.c | 9 |
2 files changed, 3 insertions, 8 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index f65a8863..3ef62755 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1127,7 +1127,7 @@ fetcher_thread (void *none) if (!got_pic && artwork_enable_lfm && !fetch_from_lastfm (param->artist, param->album, cache_path)) { got_pic = 1; } - else if (!got_pic && artwork_enable_aao && !fetch_from_albumart_org (param->artist, param->album, cache_path)) { + if (!got_pic && artwork_enable_aao && !fetch_from_albumart_org (param->artist, param->album, cache_path)) { got_pic = 1; } } diff --git a/plugins/gtkui/coverart.c b/plugins/gtkui/coverart.c index a2f1119a..f98957dc 100644 --- a/plugins/gtkui/coverart.c +++ b/plugins/gtkui/coverart.c @@ -148,24 +148,20 @@ loading_thread (void *none) { if (stat (queue->fname, &stat_buf) < 0) { trace ("failed to stat file %s\n", queue->fname); } - trace ("covercache: caching pixbuf for %s\n", queue->fname); GdkPixbuf *pixbuf = NULL; GError *error = NULL; pixbuf = gdk_pixbuf_new_from_file_at_scale (queue->fname, queue->width, queue->width, TRUE, &error); if (!pixbuf) { unlink (queue->fname); - fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error->message); + fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error ? error->message : "n/a"); if (error) { g_error_free (error); error = NULL; } const char *defpath = coverart_plugin->get_default_cover (); - if (stat (defpath, &stat_buf) < 0) { - trace ("failed to stat file %s\n", queue->fname); - } pixbuf = gdk_pixbuf_new_from_file_at_scale (defpath, queue->width, queue->width, TRUE, &error); if (!pixbuf) { - fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", defpath, queue->width, error->message); + fprintf (stderr, "default cover: gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", defpath, queue->width, error->message); } } if (error) { @@ -192,7 +188,6 @@ loading_thread (void *none) { queue->callback (queue->user_data); } queue_pop (); - //g_idle_add (redraw_playlist_cb, NULL); } if (terminate) { break; |