summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2013-03-16 08:44:32 +0000
committerwm4 <wm4@nowhere>2013-04-04 14:03:22 +0200
commit3dedcdde601ae22ebfd5b2a7d6909ecdc0c34312 (patch)
tree98d215ac6732d2944703f36280202aab71f5f838 /stream
parent18755dcbea574eee0105fe973d1842fd046d28e4 (diff)
downloadmpv-3dedcdde601ae22ebfd5b2a7d6909ecdc0c34312.tar.bz2
mpv-3dedcdde601ae22ebfd5b2a7d6909ecdc0c34312.tar.xz
vcd_read: cleanup ifdefs
Clean up ifdefs so they make sense even if none or multiple are defined. Also choose Linux as fallback case instead of failing, this allows the code to compile e.g. on Android. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35971 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/vcd_read.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/stream/vcd_read.h b/stream/vcd_read.h
index 9d0f68ea66..2d4a88604a 100644
--- a/stream/vcd_read.h
+++ b/stream/vcd_read.h
@@ -29,17 +29,16 @@
#include "core/mp_msg.h"
#include "stream.h"
//=================== VideoCD ==========================
-#if defined(__linux__) || defined(sun) || defined(__bsdi__)
typedef struct mp_vcd_priv_st mp_vcd_priv_t;
-#if defined(__linux__)
-#include <linux/cdrom.h>
-#elif defined(sun)
+#ifdef sun
#include <sys/cdio.h>
static int sun_vcd_read(mp_vcd_priv_t*, int*);
-#elif defined(__bsdi__)
+#elif defined(__bsdi__)
#include <dvd.h>
+#else
+#include <linux/cdrom.h>
#endif
struct mp_vcd_priv_st {
@@ -154,11 +153,11 @@ static int vcd_end_track(mp_vcd_priv_t* vcd)
}
static int vcd_read(mp_vcd_priv_t* vcd,char *mem){
-#if defined(__linux__) || defined(__bsdi__)
+#ifndef sun
memcpy(vcd->buf,&vcd->entry.cdte_addr.msf,sizeof(struct cdrom_msf));
if(ioctl(vcd->fd,CDROMREADRAW,vcd->buf)==-1) return 0; // EOF?
memcpy(mem,&vcd->buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
-#elif defined(sun)
+#else
{
int offset;
if (sun_vcd_read(vcd, &offset) <= 0) return 0;
@@ -180,7 +179,7 @@ static int vcd_read(mp_vcd_priv_t* vcd,char *mem){
}
-#ifdef sun
+#ifdef sun
#include <sys/scsi/generic/commands.h>
#include <sys/scsi/impl/uscsi.h>
@@ -251,10 +250,4 @@ static int sun_vcd_read(mp_vcd_priv_t* vcd, int *offset)
}
#endif /*sun*/
-#else /* __linux__ || sun || __bsdi__ */
-
-#error vcd is not yet supported on this arch...
-
-#endif
-
#endif /* MPLAYER_VCD_READ_H */