diff options
author | Petr Salinger ext:(%20) <Petr.Salinger@seznam.cz> | 2007-11-19 17:42:21 +0000 |
---|---|---|
committer | Petr Salinger ext:(%20) <Petr.Salinger@seznam.cz> | 2007-11-19 17:42:21 +0000 |
commit | ff8930972b4242d31e540a38f1d8053e846d68e6 (patch) | |
tree | d91fbd6ed9cb6930f81faa7a3d9884acf8c0d4a1 /src/input/input_cdda.c | |
parent | cbaade083f6378381a96eacf76b0d2a522c675ae (diff) | |
download | xine-lib-ff8930972b4242d31e540a38f1d8053e846d68e6.tar.gz xine-lib-ff8930972b4242d31e540a38f1d8053e846d68e6.tar.bz2 |
add support for GNU/kFreeBSD
It changes some "defined (__FreeBSD__)" into "defined (__FreeBSD_kernel__)"
and "__FreeBSD_version" into "__FreeBSD_kernel_version".
The changes are performed on places, where feature of kernel is tested. On
some other places, feature of userland/libc is tested, on them "defined
(__FreeBSD__)" remains.
As proposed, include/configure.h cause __FreeBSD_kernel__ be defined if
__FreeBSD__ is defined.
--HG--
extra : transplant_source : %25%96K%05%E4Y%B15%94%60%15%FE1%8Ah%26Xy%8C/
Diffstat (limited to 'src/input/input_cdda.c')
-rw-r--r-- | src/input/input_cdda.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 35650c858..5f830a1d3 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -612,7 +612,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f return 0; } -#elif defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(__FreeBSD_kernel__) || defined(__NetBSD__) #include <sys/cdio.h> @@ -623,7 +623,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f static int read_cdrom_toc(int fd, cdrom_toc *toc) { struct ioc_toc_header tochdr; -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) struct ioc_read_toc_single_entry tocentry; #elif defined(__NetBSD__) struct ioc_read_toc_entry tocentry; @@ -654,7 +654,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { memset(&tocentry, 0, sizeof(tocentry)); -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) tocentry.track = i; tocentry.address_format = CD_MSF_FORMAT; if (ioctl(fd, CDIOREADTOCENTRY, &tocentry) == -1) { @@ -673,7 +673,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) toc->toc_entries[i-1].track_mode = (tocentry.entry.control & 0x04) ? 1 : 0; toc->toc_entries[i-1].first_frame_minute = tocentry.entry.addr.msf.minute; toc->toc_entries[i-1].first_frame_second = tocentry.entry.addr.msf.second; @@ -697,7 +697,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { /* fetch the leadout as well */ memset(&tocentry, 0, sizeof(tocentry)); -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) tocentry.track = CD_LEADOUT_TRACK; tocentry.address_format = CD_MSF_FORMAT; if (ioctl(fd, CDIOREADTOCENTRY, &tocentry) == -1) { @@ -716,7 +716,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { } #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD_kernel__) toc->leadout_track.track_mode = (tocentry.entry.control & 0x04) ? 1 : 0; toc->leadout_track.first_frame_minute = tocentry.entry.addr.msf.minute; toc->leadout_track.first_frame_second = tocentry.entry.addr.msf.second; @@ -745,8 +745,8 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f int fd = this_gen->fd; while( num_frames ) { -#if defined(__FreeBSD__) -#if __FreeBSD_version < 501106 +#if defined(__FreeBSD_kernel__) +#if __FreeBSD_kernel_version < 501106 struct ioc_read_audio cdda; cdda.address_format = CD_MSF_FORMAT; @@ -755,13 +755,10 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f 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) { +#else + if (pread(fd, data, CD_RAW_FRAME_SIZE, frame * CD_RAW_FRAME_SIZE) != CD_RAW_FRAME_SIZE) { #endif perror("CDIOCREADAUDIO"); return -1; |