[goobox] Bug 697966: use libdiscid read_sparse()



commit ef3f25682850798b90b57331c8bbb5669f9f59d9
Author: Johannes Dewender <gnome JonnyJD net>
Date:   Sat Apr 13 23:07:12 2013 +0200

    Bug 697966: use libdiscid read_sparse()
    
    read() extracts ISRCs and the MCN starting with libdiscid 0.3.1, which
    is quite a bit slower then only reading the TOC.
    
    read_sparse() is available since libdiscid 0.5.0 and only reads the
    TOC, unless additional features are requested.
    We fall back to read() if that isn't available.

 src/metadata.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/metadata.c b/src/metadata.c
index d980fe7..96ee696 100644
--- a/src/metadata.c
+++ b/src/metadata.c
@@ -33,6 +33,10 @@
 
 #define QUERY_AGENT (PACKAGE_NAME "-" PACKAGE_VERSION)
 
+#ifndef DISCID_HAVE_SPARSE_READ
+#define discid_read_sparse(disc, dev, i) discid_read(disc, dev)
+#endif
+
 
 static TrackInfo *
 get_track_info (Mb5Track mb_track,
@@ -331,7 +335,7 @@ get_cd_info_from_device_thread (GSimpleAsyncResult *result,
        data->album_info = album_info_new ();
        tracks = NULL;
        disc = discid_new ();
-       if (discid_read (disc, data->device)) {
+       if (discid_read_sparse (disc, data->device, 0)) {
                int first_track;
                int last_track;
                int i;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]