patches/cdfs-0.5c-discid-2.diff
author nathan
Sat, 29 Dec 2007 14:56:02 +0100
branchtrunk
changeset 9 dc75c2890a31
parent 0 474a1293c3c0
permissions -rw-r--r--
generate plugin version from hg identify
     1 --- discid.c.orig	2001-12-27 19:48:57.000000000 +0100
     2 +++ discid.c	2004-02-23 20:18:45.000000000 +0100
     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  
    26 --- root.c.orig	2002-04-07 18:31:39.000000000 +0200
    27 +++ root.c	2005-02-05 17:27:48.000000000 +0100
    28 @@ -146,6 +146,10 @@
    29          this_cd->track[i].type        = AUDIO;
    30          this_cd->track[i].time        = CURRENT_TIME;
    31          this_cd->track[i].iso_size    = 0;
    32 +        if ((t!=(this_cd->tracks - 1)) && t > 0 && (this_cd->track[i + 1].type!=AUDIO)) {
    33 +          this_cd->track[i].track_size = this_cd->track[i].track_size - 11400;
    34 +          this_cd->track[i].stop_lba = this_cd->track[i].stop_lba -11400;
    35 +        }
    36          this_cd->track[i].track_size  = this_cd->track[i].track_size * CD_FRAMESIZE_RAW + ((this_cd->raw_audio==0)?WAV_HEADER_SIZE:0);
    37          this_cd->track[i].size        = this_cd->track[i].track_size;
    38  	this_cd->track[i].avi         = 0;