aboutsummaryrefslogtreecommitdiff
path: root/audio/xmms-cdread
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2003-11-20 22:31:21 +0000
committerPav Lucistnik <pav@FreeBSD.org>2003-11-20 22:31:21 +0000
commit5998c8ec9b49be1115459c7a0e1ce7b4f3e42783 (patch)
tree1eaffcb97ae75ec6eebdea24e3fa645387d49ab2 /audio/xmms-cdread
parentc7ce6ff43e4c762904be72db1cf35e261a923bb4 (diff)
downloadports-5998c8ec9b49be1115459c7a0e1ce7b4f3e42783.tar.gz
ports-5998c8ec9b49be1115459c7a0e1ce7b4f3e42783.zip
- Adapt for ATAng (unbreak on -CURRENT).
PR: ports/59514 Submitted by: Sergey V. Belov <argail@visit.ru> (maintainer) Approved by: adamw (mentor)
Notes
Notes: svn path=/head/; revision=94556
Diffstat (limited to 'audio/xmms-cdread')
-rw-r--r--audio/xmms-cdread/Makefile8
-rw-r--r--audio/xmms-cdread/files/patch-cdrombsd.h44
2 files changed, 40 insertions, 12 deletions
diff --git a/audio/xmms-cdread/Makefile b/audio/xmms-cdread/Makefile
index fdeadab26db6..0c5f1f176552 100644
--- a/audio/xmms-cdread/Makefile
+++ b/audio/xmms-cdread/Makefile
@@ -24,10 +24,4 @@ INSTALLS_SHLIB= yes
CONFIGURE_ENV= CFLAGS="${CFLAGS} -L${LOCALBASE}/lib"
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 501106
-BROKEN= "Broken by new ATA driver"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/audio/xmms-cdread/files/patch-cdrombsd.h b/audio/xmms-cdread/files/patch-cdrombsd.h
index 9fda4b4b7f6f..08d230a14279 100644
--- a/audio/xmms-cdread/files/patch-cdrombsd.h
+++ b/audio/xmms-cdread/files/patch-cdrombsd.h
@@ -1,6 +1,16 @@
---- cdrombsd.h.orig Sat Aug 18 19:09:10 2001
-+++ cdrombsd.h Sun Mar 23 16:35:33 2003
-@@ -9,12 +9,9 @@
+--- cdrombsd.h.orig Sat Aug 18 15:09:10 2001
++++ cdrombsd.h Thu Nov 20 19:24:05 2003
+@@ -5,15 +5,19 @@
+ #ifndef CDROMBSD_H
+ #define CDROMBSD_H
+ #include <sys/param.h>
++#if __FreeBSD_version >= 501106
++#include <sys/cdrio.h>
++#ifndef CD_FRAMESIZE_RAW
++#define CD_FRAMESIZE_RAW 2352
++#endif
++#endif
+ /*\
|*| FreeBSD (?) specific code
\*/
@@ -9,10 +19,34 @@
- ((entry.addr.msf.minute * 60 + \
- entry.addr.msf.second) * 75 + \
- entry.addr.msf.frame))
--
+#define GET_LBA(entry) ((entry.addr.msf.minute * 60 \
+ + entry.addr.msf.second) * 75 \
+ + entry.addr.msf.frame)
+
/*\
- |*| Open cdrom device
+@@ -84,6 +88,16 @@
+ |*| from device cdfd, at position lba
+ |*| Return number of successfully read frames, -1 on error.
+ \*/
++#if __FreeBSD_version >= 501106
++static int
++cdrom_read_audio(int cdfd, int lba, char *buf, int btw)
++{
++ int bsize = CD_FRAMESIZE_RAW;
++ if (ioctl(cdfd, CDRIOCSETBLOCKSIZE, &bsize) == -1) return -errno;
++ if (pread(cdfd, buf, btw*bsize, (lba - 150)*bsize) != btw*bsize) return 0;
++ return btw;
++}
++#else // 4-STABLE
+ static int
+ cdrom_read_audio(int cdfd, int lba, char *buf, int btw)
+ {
+@@ -101,6 +115,7 @@
+ } while (--rtr >= 0);
+ return -1;
+ }
++#endif // FreeBSD_version
+
+ /*\ Play audio from lba address from, to lba address to
+ |*| return -1 on failure