ports/57227: audio/dagrab fix to work under -CURRENT
Vladimir Kushnir
vkushnir at Alfacom.net
Thu Sep 25 23:00:43 UTC 2003
>Number: 57227
>Category: ports
>Synopsis: audio/dagrab fix to work under -CURRENT
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Sep 25 16:00:39 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Vladimir Kushnir
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD kushnir1.kiev.ua 5.1-CURRENT FreeBSD 5.1-CURRENT #11: Tue Sep 23 12:56:27 EEST 2003 root at kushnir1.kiev.ua:/usr/obj/usr/src/sys/KUSHNIR i386
>Description:
Under FreeBSD-CURRENT, dagrab does not work because CDIOCREADAUDIO
ioctl was removed.
>How-To-Repeat:
Try to use it.
>Fix:
Apply the patch below _after_ "make patch" was done in port
NB: This patch is for -CURRENT
--- patch-dagrab.c.1 begins here ---
*** /usr/ports/audio/dagrab/work/dagrab-0.3.5/dagrab.c Wed Sep 24 01:39:03 2003
--- dagrab.c Wed Sep 24 01:42:20 2003
***************
*** 104,109 ****
--- 104,110 ----
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/cdio.h>
+ #include <sys/cdrio.h>
#include <sys/param.h>
#include <sys/mount.h>
#define CDDEVICE "/dev/cdrom"
***************
*** 248,262 ****
/*NOTE: if num>CDROM_NBLOCKS_BUFFER as defined in ide_cd.c (8 in linux 2.0.32)
jitter correction may be required inside the block. */
{
! struct ioc_read_audio ra;
!
! ra.address.lba=lba;
! ra.address_format=CD_LBA_FORMAT;
! ra.nframes=num;
! ra.buffer=buf;
! if(ioctl(cdrom_fd,CDIOCREADAUDIO,&ra)){
/*fprintf(stderr,"%s: read raw ioctl failed \n",progname);*/
! fprintf(stderr,"\n%s: read raw ioctl failed at lba %d length %d: %s\n",
progname,lba,num,strerror(errno));
exit(1);
}
--- 249,262 ----
/*NOTE: if num>CDROM_NBLOCKS_BUFFER as defined in ide_cd.c (8 in linux 2.0.32)
jitter correction may be required inside the block. */
{
! int bsize = 2352;
! if(ioctl(cdrom_fd,CDRIOCSETBLOCKSIZE,&bsize) == -1) {
! fprintf(stderr, "setblocksize");
! exit(1);
! }
! if (pread(cdrom_fd, buf, num*bsize, lba*bsize) != num*bsize){
/*fprintf(stderr,"%s: read raw ioctl failed \n",progname);*/
! fprintf(stderr,"\n%s: read device at lba %d length %d: %s\n",
progname,lba,num,strerror(errno));
exit(1);
}
***************
*** 687,693 ****
}
tl->starts[tl->max-tl->min+1]=ntohl(Te.entry.addr.lba);
tl->types[tl->max-tl->min+1]=Te.entry.control&CDROM_DATA_TRACK;
!
i=cddb_main(tl);
if(i==-1) {
fprintf(stderr,"%s: error retrieving cddb data\n",PROGNAME);
--- 687,693 ----
}
tl->starts[tl->max-tl->min+1]=ntohl(Te.entry.addr.lba);
tl->types[tl->max-tl->min+1]=Te.entry.control&CDROM_DATA_TRACK;
!
i=cddb_main(tl);
if(i==-1) {
fprintf(stderr,"%s: error retrieving cddb data\n",PROGNAME);
***************
*** 1096,1101 ****
--- 1096,1102 ----
}
}
};
+
if(opt_verbose) fprintf(stderr,
"sectors %3d overlap %3d key length %3d retrys %4d offset %3d\n",
opt_blocks,opt_overlap,opt_keylen,opt_retrys,opt_ofs);
--- patch-dagrab.c.1 ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list