[MPlayer-cvslog] r35971 - trunk/stream/vcd_read.h

reimar subversion at mplayerhq.hu
Sat Mar 16 09:44:33 CET 2013


Author: reimar
Date: Sat Mar 16 09:44:32 2013
New Revision: 35971

Log:
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.

Modified:
   trunk/stream/vcd_read.h

Modified: trunk/stream/vcd_read.h
==============================================================================
--- trunk/stream/vcd_read.h	Sat Mar 16 04:54:05 2013	(r35970)
+++ trunk/stream/vcd_read.h	Sat Mar 16 09:44:32 2013	(r35971)
@@ -27,17 +27,16 @@
 #include "stream.h"
 #include "libavutil/intreadwrite.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 {
@@ -151,11 +150,11 @@ static int vcd_end_track(mp_vcd_priv_t* 
 }
 
 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;
@@ -177,7 +176,7 @@ static int vcd_read(mp_vcd_priv_t* vcd,c
 }
 
 
-#ifdef	sun
+#ifdef sun
 #include <sys/scsi/generic/commands.h>
 #include <sys/scsi/impl/uscsi.h>
 
@@ -248,10 +247,4 @@ static int sun_vcd_read(mp_vcd_priv_t* v
 }
 #endif	/*sun*/
 
-#else /* __linux__ || sun || __bsdi__ */
-
-#error vcd is not yet supported on this arch...
-
-#endif
-
 #endif /* MPLAYER_VCD_READ_H */


More information about the MPlayer-cvslog mailing list