calculates wrong cddb id due to missing pregap
VLC does not retrieve the cddb information for some CDs. I did a little digging with gdb and discovered that vlc calculates an incorrect cddb disc ID - the parts generated from the disc length and number of tracks is correct, but the part generated from track offsets is wrong. But other tools do calculate the disc id and retrieve track information from freedb.
The problem seems to be vlc treating the first track as if it starts from an offset of zero and not 150 frames (the initial pregap).
Breaking inside cdda.c:GetCDDBInfo()
gdb) print i_titles
$1 = 13
(gdb) print p_sectors[0]
$2 = 0
(gdb) print p_sectors[1]
$3 = 17435
(gdb) print p_sectors[2]
$4 = 31076
...
(gdb) print p_sectors[12]
$14 = 193574
...
(gdb) s
cddb_disc_calc_discid (disc=0x7fffd8022060) at cddb_disc.c:501
...
(gdb) print disc->length
$27 = 2767
(gdb) print /x disc->discid
$28 = ac0acf0d
compare with cddb_query (part of libcddb):
$ cddb_query calc
CD-ROM device: /dev/cdrom
CD contains 13 track(s)
CD disc ID is bd0acf0d
use values from vlc gdb session
$ cddb_query calc 2767 13 0 17435 31076 44435 60390 76785 95673 104302 125194 140730 148824 166958 193574
CD disc ID is ac0acf0d
add 2 second pregap to above values and adjust offsets accordingly
$ cddb_query calc 2767 13 150 17585 31226 44585 60540 76935 95823 104452 125344 140880 148974 167108 193724
CD disc ID is bd0acd0d
Packages affected:
vlc-1.1.5-1.fc13.x86_64
libcddb-1.3.2-4.fc13.x86_64
libcdio-0.82-2.fc13.x86_64
I don't see any recent changes in git relevant to cdda/cddb/cdrom, so haven't yet tested master.