summaryrefslogtreecommitdiff
path: root/sysutils/cdrtools-devel/files/patch-cdda2wav::interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/cdrtools-devel/files/patch-cdda2wav::interface.c')
-rw-r--r--sysutils/cdrtools-devel/files/patch-cdda2wav::interface.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/sysutils/cdrtools-devel/files/patch-cdda2wav::interface.c b/sysutils/cdrtools-devel/files/patch-cdda2wav::interface.c
index ba5d9bfba731..0e0f7f7c46ab 100644
--- a/sysutils/cdrtools-devel/files/patch-cdda2wav::interface.c
+++ b/sysutils/cdrtools-devel/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;