bug in cddb discid calculation ?

Alexander Neundorf neundorf at kde.org
Sun May 11 22:52:45 BST 2003


Hi,

it seems to me that there is a bug or strange feature in cddb.cpp 
CDDB::trackOffsetListToId(list).
I filled list with the following values:
150, 16804, 33636, 48684, 64809, 80850, 100138, 116054, 134160, 149393, 
163605, 180041, 198248, 217393, 232278, 0, 249249

With 150 tp 232278 the start frames of Clawfinger "Whole lot of nothing".
>From the examples in the test directory of libkcddb I found appended to this 
list a "disc start" and a "disc end". "Disc end" seems to be the start frame 
of the leadout track, but "disc start" uses very small values (5 or 10 in the 
examples), I didn't find out what this should be and used simply 0 (as you 
see in my list of numbers).
Now, the algorithm generates "e70cfb0f" instead of "e70cf90f", what would be 
correct (according to the returned cddb entry and to cd-discid and discid 
linked from www.freedb.org).
The reason seems to be line 67:

    unsigned int l = (list[numTracks + 1] + 1) / 75;
    l -= list[numTracks] / 75;

I changed it to 
    l -= list[0] / 75;

and now it works.

list[numTracks] is this strange "disc start" value, list[0] is the start frame 
of the first track.
I think the code should be changed to not include this useless (?) "disc 
start" in the list and use the start frame of the first track instead.

I'm not subscribed to this list, so please CC me.

Bye
Alex
-- 
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org                - http://www.kde.org
      alex at neundorf.net               - http://www.neundorf.net



More information about the kde-multimedia mailing list