changeset 23896:ae9ebf311ffd

Make VCD work on little-endian macs
author reimar
date Sun, 29 Jul 2007 15:37:30 +0000
parents 5ebab6056efc
children f4d419485f3e
files stream/vcd_read_darwin.h
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/vcd_read_darwin.h	Sun Jul 29 15:35:52 2007 +0000
+++ b/stream/vcd_read_darwin.h	Sun Jul 29 15:37:30 2007 +0000
@@ -4,6 +4,7 @@
 #include <IOKit/storage/IOCDTypes.h>
 #include <IOKit/storage/IOCDMedia.h>
 #include <IOKit/storage/IOCDMediaBSDClient.h>
+#include "mpbswap.h"
 
 //=================== VideoCD ==========================
 #define	CDROM_LEADOUT	0xAA
@@ -56,7 +57,7 @@
 		mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif1: %s\n",strerror(errno));
 		return -1;
 	}
-	vcd->msf = CDConvertLBAToMSF(entry.trackStartAddress);
+	vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
 	return VCD_SECTOR_DATA*vcd_get_msf(vcd);
 }
 
@@ -90,7 +91,7 @@
 		mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif2: %s\n",strerror(errno));
 		return -1;
 	}
-	vcd->msf = CDConvertLBAToMSF(entry.trackStartAddress);
+	vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
 	return VCD_SECTOR_DATA*vcd_get_msf(vcd);
 }
 
@@ -134,7 +135,7 @@
 			return NULL;
 		}
 		
-		trackMSF = CDConvertLBAToMSF(entry.trackStartAddress);
+		trackMSF = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
         
 		//mp_msg(MSGT_OPEN,MSGL_INFO,"track %02d:  adr=%d  ctrl=%d  format=%d  %02d:%02d:%02d\n",
 		if (i<=hdr.lastTrackNumberInLastSessionLSB)