Patch for FixupTOC

[email protected] Wed, 6 Nov 2002 23:21:21 +0100
Newsgroups gmane.comp.audio.cd-paranoia.devel
Message-ID <[email protected]>
Hi
I think I've found a bug (or maybe incompatibility with my cd-drive.) I
tried ripping a cd of mine with a pre-track, and cdparanoia just went
nuts. It seemed cdparanoia thought the last track had a negative number
of sectors, which made it impossible to get anything from the cd except
a part of the pre-track. I tracked down the bug to the multi-session
fix in FixupTOC, and I've attach my patch. I don't say this is the Right
Way to do it (haven't tested against a multi-session cd), but I don't
think it will cause any incompabilities.

Otherwice it's a GREAT TOOL. Thanx

-- 
Erik MÃ¥nsson

 Zapp: Now that's a wave of destruction that's easy on the eyes.
cdparanoia-III-alpha9.8.diff (text/plain, 777 B)
diff -urN cdparanoia-III-alpha9.8/interface/common_interface.c cdparanoia-III-alpha9.8.new/interface/common_interface.c
--- cdparanoia-III-alpha9.8/interface/common_interface.c	2000-04-20 00:40:42.000000000 +0200
+++ cdparanoia-III-alpha9.8.new/interface/common_interface.c	2002-11-06 23:06:03.000000000 +0100
@@ -223,7 +223,8 @@
       /* adjust end of last audio track to be in the first session */
       for (j = tracks-1; j >= 0; j--) {
 	if (j > 0 && !IS_AUDIO(d,j) && IS_AUDIO(d,j-1)) {
-	  if (d->disc_toc[j].dwStartSector > ms_str.addr.lba - 11400) 
+	  if ((d->disc_toc[j].dwStartSector > ms_str.addr.lba - 11400) &&
+            (ms_str.addr.lba - 11400 > d->disc_toc[j-1].dwStartSector))
 	    d->disc_toc[j].dwStartSector = ms_str.addr.lba - 11400;
 	  break;
 	}
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE9yZX1dDhBZt0CHKkRAmPOAJ91EbIELyun/NmmF8xytf+G69qS2ACgjkyH
Z9IS6woi8P7OhQ75O0XX2jo=
=HwmV
-----END PGP SIGNATURE-----