ports/57226: audio/cdparanoia fix to work with cooked_ioctl under -CURRENT
Simon Barner
barner at in.tum.de
Thu Nov 6 01:34:50 UTC 2003
[ Added Cc for maintainer of the cdparanoia port and Max Khon who posted
the patch on current at .
Credits:
vkushnir at Alfacom.net -- originator of the patch
fjoe at iclub.nsu.ru -- unified version for 4.x and 5.x
barner at in.tum.de -- added CDRIOCSETBLOCKSIZE, integration and testing
]
> It would be great if we stop using CDIOCREADAUDIO in all case and
> migrate to CDRIOCSETBLOCKSIZE which has been available since
> 4.0-RELEASE.
Ah, good to know. I wanted to research on that anyway.
> Or it just doesn't work on non-current system?
It works fine for me.
Here is a version of Max Khon's patch that he posted on current at .
I used also CDRIOCSETBLOCKSIZE, as you requested. The is no measurable
performance gain when I omit that ioctl, and I don't know what might
happen if the block size is not set every time.
Tested on -stable and -current
diff -ruN cdparanoia/Makefile cdparanoia.patched/Makefile
--- cdparanoia/Makefile Mon Jul 14 04:52:55 2003
+++ cdparanoia.patched/Makefile Thu Nov 6 01:49:47 2003
@@ -7,7 +7,7 @@
PORTNAME= cdparanoia
PORTVERSION= 3.9.8
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= audio sysutils
MASTER_SITES= http://www.xiph.org/paranoia/download/
DISTNAME= ${PORTNAME}-${PORTVERSION:C/^3\./III-alpha/}
diff -ruN cdparanoia/files/patch-interface-cooked_interface.c cdparanoia.patched/files/patch-interface-cooked_interface.c
--- cdparanoia/files/patch-interface-cooked_interface.c Sat Jan 11 10:15:00 2003
+++ cdparanoia.patched/files/patch-interface-cooked_interface.c Thu Nov 6 01:54:16 2003
@@ -1,11 +1,5 @@
-Index: interface/cooked_interface.c
-===================================================================
-RCS file: /home/cvs/cdparanoia/interface/cooked_interface.c,v
-retrieving revision 1.1.1.1
-retrieving revision 1.8
-diff -u -r1.1.1.1 -r1.8
---- interface/cooked_interface.c 2003/01/05 09:46:26 1.1.1.1
-+++ interface/cooked_interface.c 2003/01/11 08:58:45 1.8
+--- interface/cooked_interface.c.orig Thu Apr 20 00:41:04 2000
++++ interface/cooked_interface.c Thu Nov 6 01:53:25 2003
@@ -1,6 +1,8 @@
/******************************************************************
* CopyPolicy: GNU Public License 2 applies
@@ -23,7 +17,7 @@
static int cooked_readtoc (cdrom_drive *d){
int i;
int tracks;
-@@ -129,6 +132,128 @@
+@@ -129,6 +132,122 @@
return(sectors);
}
@@ -96,18 +90,12 @@
+cooked_read(cdrom_drive *d, void *p, long begin, long sectors)
+{
+ int retry_count = 0;
-+ struct ioc_read_audio arg;
-+
-+ if (sectors > d->nsectors)
-+ sectors = d->nsectors;
-+
-+ arg.address_format = CD_LBA_FORMAT;
-+ arg.address.lba = begin;
-+ arg.buffer = p;
++ int bsize = CD_FRAMESIZE_RAW;
+
+ for (;;) {
-+ arg.nframes = sectors;
-+ if (ioctl(d->ioctl_fd, CDIOCREADAUDIO, &arg) == -1) {
++ if (ioctl(d->ioctl_fd, CDRIOCSETBLOCKSIZE, &bsize) == -1)
++ return -7;
++ if (pread(d->ioctl_fd, p, sectors*bsize, begin*bsize) != sectors*bsize) {
+ if (!d->error_retry)
+ return -7;
+
@@ -152,7 +140,7 @@
/* hook */
static int Dummy (cdrom_drive *d,int Switch){
return(0);
-@@ -193,6 +318,7 @@
+@@ -193,6 +312,7 @@
int cooked_init_drive (cdrom_drive *d){
int ret;
@@ -160,7 +148,7 @@
switch(d->drive_type){
case MATSUSHITA_CDROM_MAJOR: /* sbpcd 1 */
case MATSUSHITA_CDROM2_MAJOR: /* sbpcd 2 */
-@@ -243,6 +369,9 @@
+@@ -243,6 +363,9 @@
default:
d->nsectors=40;
}
More information about the freebsd-ports-bugs
mailing list