summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Dewender <gnome@JonnyJD.net>2013-04-12 19:15:09 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2013-09-23 11:50:35 +0200
commit1a55823d38bf450d1280e6c6842cdaa19e7ea5bb (patch)
treebf300c54f72b4e37489bc1d5c5f71e6c12c72776
parentfe994d406eb8ae6e3f6bac1ccb1ef5e4d5afdd3e (diff)
Use libdiscid read_sparse()
read_sparse is available starting with libdiscid 0.5.0. Using read() started to be slow with 0.3.1, since now ISRCs and the MCN are read by default. We now only read what we need. https://bugzilla.gnome.org/show_bug.cgi?id=697899
-rw-r--r--libjuicer/sj-metadata-musicbrainz5.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libjuicer/sj-metadata-musicbrainz5.c b/libjuicer/sj-metadata-musicbrainz5.c
index 9604449..86d906a 100644
--- a/libjuicer/sj-metadata-musicbrainz5.c
+++ b/libjuicer/sj-metadata-musicbrainz5.c
@@ -46,6 +46,10 @@
field = g_strdup (buffer); \
}
+#ifndef DISCID_HAVE_SPARSE_READ
+#define discid_read_sparse(disc, dev, i) discid_read(disc, dev)
+#endif
+
#define GCONF_MUSICBRAINZ_SERVER "/apps/sound-juicer/musicbrainz_server"
#define GCONF_PROXY_USE_PROXY "/system/http_proxy/use_http_proxy"
#define GCONF_PROXY_HOST "/system/http_proxy/host"
@@ -547,7 +551,7 @@ mb5_list_albums (SjMetadata *metadata, char **url, GError **error)
priv->disc = discid_new ();
if (priv->disc == NULL)
return NULL;
- if (discid_read (priv->disc, priv->cdrom) == 0)
+ if (discid_read_sparse (priv->disc, priv->cdrom, 0) == 0)
return NULL;
if (url != NULL)