After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697966 - [PATCH] creating the disc id to fetch metadata became slow starting with libdiscid 0.3.1
[PATCH] creating the disc id to fetch metadata became slow starting with libd...
Status: RESOLVED FIXED
Product: goobox
Classification: Other
Component: player
3.2.x
Other Linux
: Normal minor
: ---
Assigned To: Goobox Maintainers
Goobox Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-13 21:02 UTC by Johannes Dewender
Modified: 2013-04-14 09:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use discid_read_sparse() when available (1.22 KB, patch)
2013-04-13 21:28 UTC, Johannes Dewender
none Details | Review

Description Johannes Dewender 2013-04-13 21:02:46 UTC
Running goobox with current libdiscid versions (starting with libdiscid 0.3.1) it takes a bit longer until the metadata is fetched and displayed.

The reason is:

Starting with libdiscid 0.3.1 discid_read() doesn't just read the TOC (which is
cached anyways), but reads ISRCs and the MCN from disc.
This is unnecessary, since this data is not used and takes more
time. (plain libdiscid read() now takes 3, rather than 0.5 seconds)

Starting with libdiscid 0.5.0 there is the option to use read_sparse() and only
read the TOC again, which should be a lot faster, since the TOC is cached.


It would also be possible to read the MCN (= EAN/UPC/"barcode") and use that to
decide which MusicBrainz release to use for the metadata to display.
Comment 1 Johannes Dewender 2013-04-13 21:28:15 UTC
Created attachment 241468 [details] [review]
use discid_read_sparse() when available

This uses discid_read_sparse() when available and falls back to using read() if not (using a define).

This was tested with goobox 3.2.0 and libdiscid 0.5.0 on Arch Linux.

With the patch there was less disc access at the start and I checked with additional debug out in libdiscid that no ISRCs and MCNs were read.
Comment 2 Johannes Dewender 2013-04-13 21:29:40 UTC
The upstream issue is at http://tickets.musicbrainz.org/browse/LIB-29
and I added a similar patch to sound-juicer in
https://bugzilla.gnome.org/show_bug.cgi?id=697899
Comment 3 Paolo Bacchilega 2013-04-14 09:22:22 UTC
patch pushed to master, thank you.