From 98fba206c5a07eae99c3fb13b5afee61a9cb5322 Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Fri, 29 Jul 2005 19:03:34 +0000 Subject: =?UTF-8?q?FreeBSD=20compatability=20patch=20by=20Diego=20"Flameey?= =?UTF-8?q?es"=20Petten=C3=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CVS patchset: 7697 CVS date: 2005/07/29 19:03:34 --- src/input/input_cdda.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index f665d71b3..dcf6e18db 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -20,7 +20,7 @@ * Compact Disc Digital Audio (CDDA) Input Plugin * by Mike Melanson (melanson@pcisys.net) * - * $Id: input_cdda.c,v 1.72 2005/05/28 09:26:59 jstembridge Exp $ + * $Id: input_cdda.c,v 1.73 2005/07/29 19:03:34 jstembridge Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -684,18 +685,26 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f 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; } -- cgit v1.2.3