patches/cdfs-0.5c-discid-1.diff
author nathan
Sat, 29 Dec 2007 14:47:40 +0100
branchtrunk
changeset 0 474a1293c3c0
permissions -rw-r--r--
release 0.10.0
     1 --- discid.c.orig	Thu Dec 27 19:48:57 2001
     2 +++ discid.c	Mon Feb 23 20:18:44 2004
     3 @@ -5,14 +5,18 @@
     4  
     5  
     6  unsigned long discid(cd * this_cd) {
     7 -  unsigned int i=0, t, n = 0;
     8 +  unsigned int i=0, t, n = 0, trks=0, l=0;
     9  
    10    for (i=0; i< this_cd->tracks; i++)
    11 -    n += cddb_sum((this_cd->track[T2I(i)].start_lba+CD_MSF_OFFSET)/CD_FRAMES);
    12 +    if(this_cd->track[T2I(i)].type==AUDIO) {
    13 +      n += cddb_sum((this_cd->track[T2I(i)].start_lba+CD_MSF_OFFSET)/CD_FRAMES);
    14 +      trks++; l=i;
    15 +      }
    16  
    17 -  t = this_cd->track[T2I(this_cd->tracks-1)].stop_lba/CD_FRAMES;
    18 +  t = (this_cd->track[T2I(l+1)].start_lba-
    19 +       this_cd->track[T2I(0)].start_lba)/CD_FRAMES;
    20  
    21 -  return (((n % 0xFF) << 24) | (t << 8) | this_cd->tracks);
    22 +  return (((n % 0xFF) << 24) | (t << 8) | trks);
    23  }
    24  
    25