Bug 318316 - [PATCH] metadata/"cddb" lookup slow starting with libdiscid 0.3.1
Summary: [PATCH] metadata/"cddb" lookup slow starting with libdiscid 0.3.1
Status: RESOLVED FIXED
Alias: None
Product: kaudiocreator
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 1.3
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Gerd Fleischer
URL: http://tickets.musicbrainz.org/browse...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-14 02:36 UTC by Johannes Dewender
Modified: 2016-09-07 01:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
use discid_read_sparse() when available (1.30 KB, patch)
2013-04-14 02:57 UTC, Johannes Dewender
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Dewender 2013-04-14 02:36:14 UTC
Fetching the album metadata takes a bit longer when using libdiscid >= 0.3.1.

The reason behind that is, that discid_read() is extracting ISRCs and the MCN from disc, rather than just fetching the TOC (which is mostly cached).
With libdiscid <= 0.2.2 only the TOC was read (from cache).
Plain discid_read() now takes 3, rather than 0.5 seconds.

Starting with libdiscid 0.5.0 discid_read_sparse() is available. This function only reads the TOC, unless requested otherwise.

Another possibility is to use the extracted MCN (= UPC/EAN/"barcode") to decide which release returned by MusicBrainz should be used for the metadata.

Reproducible: Always

Steps to Reproduce:
1. Start kaudiocreator
2. Choose a device with an audio disc in it
3. listen to and wait for the device to make skipping noise for approx. 3 seconds.



I am reproducing this using kaudiocreator 1.3 and libdiscid 0.5.0 on Arch Linux.
I also added a bit of debug output to libdiscid ISRC and MCN extraction in order to check what it is doing.
Comment 1 Johannes Dewender 2013-04-14 02:57:10 UTC
Created attachment 78885 [details]
use discid_read_sparse() when available

This uses discid_read_sparse() when available (and read() if not).

Tested with kaudiocreator 1.3 and libdiscid 0.5.0.
With earlier libdiscid versions there is no difference, since discid_read_sparse() is not available and read() is used due to the define.

Works as expected.
The metadata is returned without even accessing the disc, as the TOC is cached (by the system). My debug output from libdiscid doesn't show reading of ISRCs or the MCN.
Comment 2 Leslie Zhai 2016-09-07 01:24:43 UTC
Git commit c7de530ca923b16a18cdf8b8948662e79b6589d1 by Leslie Zhai.
Committed on 07/09/2016 at 01:23.
Pushed by lesliezhai into branch 'master'.

Speed up metadata/cddb lookup.
CCMAIL: github@JonnyJD.net

M  +5    -1    audiocd.cpp

http://commits.kde.org/kaudiocreator/c7de530ca923b16a18cdf8b8948662e79b6589d1