Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 2003 14:05:40 +0100
From:      Simon Barner <barner@in.tum.de>
To:        freebsd-ports-bugs@FreeBSD.org, vkushnir@Alfacom.net
Subject:   Re: ports/57226: audio/cdparanoia fix to work with cooked_ioctl under -CURRENT
Message-ID:  <20031105130540.GB411@zi025.glhnet.mhn.de>
In-Reply-To: <200311050450.hA54oLUA027741@freefall.freebsd.org>
References:  <200311050450.hA54oLUA027741@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>  I improved the patch to make use of ${OSVERSION}. Since there was no version
>  bump for ATAng, I used the next version that after sos@'s commit in order to
>  make a case destinction.

I cleaned this up: I am using __FreeBSD_version in the patch file itself
instead of two extra-patches.

Simon

diff -ruN cdparanoia/Makefile cdparanoia.patched/Makefile
--- cdparanoia/Makefile	Mon Jul 14 04:52:55 2003
+++ cdparanoia.patched/Makefile	Wed Nov  5 14:00:32 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	Wed Nov  5 12:27:39 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	Wed Nov  5 12:22:46 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,141 @@
    return(sectors);
  }
  
@@ -96,6 +90,10 @@
 +cooked_read(cdrom_drive *d, void *p, long begin, long sectors)
 +{
 +	int retry_count = 0;
++/* CDIOCREADAUDIO has been removed in FreeBSD 5.1-CURRENT */
++#if __FreeBSD_version >= 501106
++	int bsize = CD_FRAMESIZE_RAW;
++#else
 +	struct ioc_read_audio arg;
 +
 +	if (sectors > d->nsectors)
@@ -104,10 +102,19 @@
 +	arg.address_format = CD_LBA_FORMAT;
 +	arg.address.lba = begin;
 +	arg.buffer = p;
++#endif
 +
 +	for (;;) {
++/* CDIOCREADAUDIO has been removed in FreeBSD 5.1-CURRENT */
++#if  __FreeBSD_version >= 501106
++		if (ioctl(d->ioctl_fd, CDRIOCSETBLOCKSIZE, &bsize) == -1) {
++			return -7;
++		} 
++		if (pread(d->ioctl_fd, p, sectors*bsize, begin*bsize) != sectors*bsize) {
++#else
 +		arg.nframes = sectors;
 +		if (ioctl(d->ioctl_fd, CDIOCREADAUDIO, &arg) == -1) {
++#endif
 +			if (!d->error_retry)
 +				return -7;
 +
@@ -152,7 +159,7 @@
  /* hook */
  static int Dummy (cdrom_drive *d,int Switch){
    return(0);
-@@ -193,6 +318,7 @@
+@@ -193,6 +331,7 @@
  int cooked_init_drive (cdrom_drive *d){
    int ret;
  
@@ -160,7 +167,7 @@
    switch(d->drive_type){
    case MATSUSHITA_CDROM_MAJOR:	/* sbpcd 1 */
    case MATSUSHITA_CDROM2_MAJOR:	/* sbpcd 2 */
-@@ -243,6 +369,9 @@
+@@ -243,6 +382,9 @@
    default:
      d->nsectors=40; 
    }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031105130540.GB411>