blob: 16e13737b59a0f0f2cde67013cee5602c79cbf9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
--- src/input/input_cdda.c.orig Sat Oct 4 01:35:54 2003
+++ src/input/input_cdda.c Sat Nov 15 21:05:51 2003
@@ -32,6 +32,7 @@
#include <unistd.h>
#include <sys/types.h>
+#include <sys/param.h>
#include <dirent.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -666,18 +667,26 @@
unsigned char *data) {
int fd = this_gen->fd;
+#if __FreeBSD_version < 501106
struct ioc_read_audio cdda;
+#endif
while( num_frames ) {
+#if __FreeBSD_version < 501106
cdda.address_format = CD_MSF_FORMAT;
cdda.address.msf.minute = frame / CD_SECONDS_PER_MINUTE / CD_FRAMES_PER_SECOND;
cdda.address.msf.second = (frame / CD_FRAMES_PER_SECOND) % CD_SECONDS_PER_MINUTE;
cdda.address.msf.frame = frame % CD_FRAMES_PER_SECOND;
cdda.nframes = 1;
cdda.buffer = data;
+#endif
+#if __FreeBSD_version >= 501106
+ if (pread(fd, data, CD_RAW_FRAME_SIZE, frame * CD_RAW_FRAME_SIZE) != CD_RAW_FRAME_SIZE) {
+#else
/* read a frame */
if(ioctl(fd, CDIOCREADAUDIO, &cdda) < 0) {
+#endif
perror("CDIOCREADAUDIO");
return -1;
}
|