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
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd.c1
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd.h2
6 files changed, 24 insertions, 26 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;
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 31ba90436..007fa5946 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;
@@ -393,7 +393,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,
char *buf, off_t nlen) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
@@ -531,7 +531,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) {
@@ -690,7 +690,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) {
@@ -764,7 +764,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 ;
@@ -859,7 +859,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));
diff --git a/src/input/vcd/libcdio/FreeBSD/freebsd.c b/src/input/vcd/libcdio/FreeBSD/freebsd.c
index daea9b3f5..5a3443e95 100644
--- a/src/input/vcd/libcdio/FreeBSD/freebsd.c
+++ b/src/input/vcd/libcdio/FreeBSD/freebsd.c
@@ -29,6 +29,7 @@
static const char _rcsid[] = "$Id: freebsd.c,v 1.1 2005/01/01 02:43:57 rockyb Exp $";
+#include <arpa/inet.h>
#include "freebsd.h"
#ifdef HAVE_FREEBSD_CDROM
diff --git a/src/input/vcd/libcdio/FreeBSD/freebsd.h b/src/input/vcd/libcdio/FreeBSD/freebsd.h
index 50894c912..bdbad406d 100644
--- a/src/input/vcd/libcdio/FreeBSD/freebsd.h
+++ b/src/input/vcd/libcdio/FreeBSD/freebsd.h
@@ -78,7 +78,7 @@ struct ioc_read_audio
#include <sys/ioctl.h>
#include <sys/param.h> /* for __FreeBSD_version */
-#if __FreeBSD_version < 500000
+#if __FreeBSD_kernel_version < 500000
#define DEVICE_POSTFIX "c"
#else
#define DEVICE_POSTFIX ""