summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/input')
-rw-r--r--src/input/input_cdda.c23
-rw-r--r--src/input/input_vcd.c18
-rw-r--r--src/input/libdvdnav/dvd_reader.c2
-rw-r--r--src/input/media_helper.c4
4 files changed, 22 insertions, 25 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 43baa3c4a..621aff14a 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -616,7 +616,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>
@@ -627,7 +627,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;
@@ -658,7 +658,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) {
@@ -677,7 +677,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;
@@ -701,7 +701,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) {
@@ -720,7 +720,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;
@@ -749,8 +749,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;
@@ -759,13 +759,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;
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index c422b2531..d5895c9a8 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -37,7 +37,7 @@
#ifdef HAVE_SYS_CDIO_H
# include <sys/cdio.h>
/* TODO: not clean yet */
-# if defined (__FreeBSD__)
+# if defined (__FreeBSD_kernel__)
# include <sys/cdrio.h>
# endif
#endif
@@ -92,7 +92,7 @@ typedef struct {
#if defined (__linux__) || defined(__sun)
struct cdrom_tochdr tochdr;
struct cdrom_tocentry tocent[100];
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
struct ioc_toc_header tochdr;
struct cd_toc_entry *tocent;
off_t cur_sec;
@@ -117,7 +117,7 @@ typedef struct {
int cur_track;
-#if defined (__linux__) || defined(__sun) || defined(__FreeBSD__)
+#if defined (__linux__) || defined(__sun) || defined (__FreeBSD_kernel__)
uint8_t cur_min, cur_sec, cur_frame;
#endif
@@ -177,7 +177,7 @@ static int input_vcd_read_toc (vcd_input_class_t *this, int fd) {
return 0;
}
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
static int input_vcd_read_toc (vcd_input_class_t *this, int fd) {
struct ioc_read_toc_entry te;
@@ -394,7 +394,7 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen,
memcpy (buf, data.data, VCDSECTORSIZE); /* FIXME */
return VCDSECTORSIZE;
}
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
static off_t vcd_plugin_read (input_plugin_t *this_gen,
void *buf_gen, off_t nlen) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
@@ -534,7 +534,7 @@ static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen,
memcpy (buf->mem, data.data, VCDSECTORSIZE); /* FIXME */
return buf;
}
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen,
fifo_buffer_t *fifo, off_t nlen) {
@@ -693,7 +693,7 @@ static off_t vcd_plugin_seek (input_plugin_t *this_gen,
return offset ; /* FIXME */
}
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
static off_t vcd_plugin_seek (input_plugin_t *this_gen,
off_t offset, int origin) {
@@ -767,7 +767,7 @@ static off_t vcd_plugin_get_length (input_plugin_t *this_gen) {
return (off_t) 0;
}
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
static off_t vcd_plugin_get_length (input_plugin_t *this_gen) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
off_t len ;
@@ -862,7 +862,7 @@ static int vcd_plugin_open (input_plugin_t *this_gen) {
this->cur_min = this->cls->tocent[this->cur_track].cdte_addr.msf.minute;
this->cur_sec = this->cls->tocent[this->cur_track].cdte_addr.msf.second;
this->cur_frame = this->cls->tocent[this->cur_track].cdte_addr.msf.frame;
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD_kernel__)
{
int bsize = 2352;
if (ioctl (this->fd, CDRIOCSETBLOCKSIZE, &bsize) == -1) {
diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c
index 1cf493ef1..200a1dbec 100644
--- a/src/input/libdvdnav/dvd_reader.c
+++ b/src/input/libdvdnav/dvd_reader.c
@@ -58,7 +58,7 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
#define lseek64 _lseeki64
#endif
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
+#if defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
#define SYS_BSD 1
#endif
diff --git a/src/input/media_helper.c b/src/input/media_helper.c
index d2b1772a4..288ed4205 100644
--- a/src/input/media_helper.c
+++ b/src/input/media_helper.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <string.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
#include <sys/cdio.h> /* CDIOCALLOW etc... */
#elif defined(HAVE_LINUX_CDROM_H)
#include <linux/cdrom.h>
@@ -130,7 +130,7 @@ int media_eject_media (xine_t *xine, const char *device)
return 0;
}
-#elif defined (__NetBSD__) || defined (__OpenBSD__) || defined (__FreeBSD__)
+#elif defined (__NetBSD__) || defined (__OpenBSD__) || defined (__FreeBSD_kernel__)
if (ioctl(fd, CDIOCALLOW) == -1) {
xprintf(xine, XINE_VERBOSITY_DEBUG, "ioctl(cdromallow): %s\n", strerror(errno));