Make VCD work on little-endian macs

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23916 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-07-29 15:37:30 +00:00
parent 1c67c05e8c
commit 2ea3b5fdb0
1 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include <IOKit/storage/IOCDTypes.h> #include <IOKit/storage/IOCDTypes.h>
#include <IOKit/storage/IOCDMedia.h> #include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IOCDMediaBSDClient.h> #include <IOKit/storage/IOCDMediaBSDClient.h>
#include "mpbswap.h"
//=================== VideoCD ========================== //=================== VideoCD ==========================
#define CDROM_LEADOUT 0xAA #define CDROM_LEADOUT 0xAA
@ -56,7 +57,7 @@ int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif1: %s\n",strerror(errno)); mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif1: %s\n",strerror(errno));
return -1; return -1;
} }
vcd->msf = CDConvertLBAToMSF(entry.trackStartAddress); vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
return VCD_SECTOR_DATA*vcd_get_msf(vcd); return VCD_SECTOR_DATA*vcd_get_msf(vcd);
} }
@ -90,7 +91,7 @@ int vcd_get_track_end(mp_vcd_priv_t* vcd, int track)
mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif2: %s\n",strerror(errno)); mp_msg(MSGT_STREAM,MSGL_ERR,"ioctl dif2: %s\n",strerror(errno));
return -1; return -1;
} }
vcd->msf = CDConvertLBAToMSF(entry.trackStartAddress); vcd->msf = CDConvertLBAToMSF(be2me_32(entry.trackStartAddress));
return VCD_SECTOR_DATA*vcd_get_msf(vcd); return VCD_SECTOR_DATA*vcd_get_msf(vcd);
} }
@ -134,7 +135,7 @@ mp_vcd_priv_t* vcd_read_toc(int fd)
return NULL; 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", //mp_msg(MSGT_OPEN,MSGL_INFO,"track %02d: adr=%d ctrl=%d format=%d %02d:%02d:%02d\n",
if (i<=hdr.lastTrackNumberInLastSessionLSB) if (i<=hdr.lastTrackNumberInLastSessionLSB)