summaryrefslogtreecommitdiff
path: root/sysutils/cdrtools/files/patch-cdda2wav::interface.c
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2004-06-02 17:16:04 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2004-06-02 17:16:04 +0000
commit2a753271f96ac9ebd1abe42b4b5acbe61d949a6f (patch)
tree86a6555435710cc8faa13f6bdb8f8b1dbf984b17 /sysutils/cdrtools/files/patch-cdda2wav::interface.c
parentUse intlhack to fix the build with Perl 5.005. (diff)
- Add a workaround for the problem that cdda2wav doesn't use a page
aligned buffer for the SCSI transfers in paranoia mode. [1] - Stop the artificial separation of mkisofs from cdrtools and merge sysutils/mkisofs into sysutils/cdrtools which brings us in line with other distributions. The separation of mkisofs caused quite some confusion among users as well as committers about why its PORTVERSION was different from the cdrtools port, how to install it, etc. PR: 63775 [1] Submitted by: marius
Diffstat (limited to 'sysutils/cdrtools/files/patch-cdda2wav::interface.c')
-rw-r--r--sysutils/cdrtools/files/patch-cdda2wav::interface.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/sysutils/cdrtools/files/patch-cdda2wav::interface.c b/sysutils/cdrtools/files/patch-cdda2wav::interface.c
index ba5d9bfba731..0e0f7f7c46ab 100644
--- a/sysutils/cdrtools/files/patch-cdda2wav::interface.c
+++ b/sysutils/cdrtools/files/patch-cdda2wav::interface.c
@@ -17,7 +17,33 @@
if (!S_ISCHR(statstruct->st_mode)) {
fprintf(stderr, "%s is not a char device\n",pdev_name);
exit(SYNTAX_ERROR);
-@@ -593,9 +601,6 @@
+@@ -555,8 +563,25 @@
+ }
+ dontneedgroup();
+ dontneedroot();
++#if defined (__FreeBSD__)
++ /*
++ * i_read_c_block(), used by paranoia_read_limited() for reading the
++ * data from the CD, doesn't use a page aligned buffer as required by
++ * FreeBSD for SCSI transfers (well, most OS do). Probably this should
++ * be dealt with in cdda_read() (called by i_read_c_block() with the
++ * unaligned buffer and in turn calls ReadCdRom() to do the actual read)
++ * but it seems like overkill to add yet another buffer (would make it
++ * 3 or so from do_read() to ReadCdRom() alone). Instead, limit the
++ * transfer size via the maximum for the sectors to read at once to a
++ * value that lets the data fit into a page (for FreeBSD the code below
++ * would set the maximum sectors to 27).
++ */
++ if (global.nsectors > 26)
++ global.nsectors = 26;
++#else
+ if (global.nsectors > (unsigned) scg_bufsize(scgp, 3*1024*1024)/CD_FRAMESIZE_RAW)
+ global.nsectors = scg_bufsize(scgp, 3*1024*1024)/CD_FRAMESIZE_RAW;
++#endif
+ if (global.overlap >= global.nsectors)
+ global.overlap = global.nsectors-1;
+
+@@ -593,9 +618,6 @@
exit(RACE_ERROR);
}
#endif
@@ -27,7 +53,7 @@
}
return retval;
}
-@@ -888,6 +893,7 @@
+@@ -888,6 +910,7 @@
FatalError("No memory for SCSI structure.\n");
}
scgp->silent = 0;