Commit 83d76fb2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Fix CDDA and VCD modules for Mac OS X Intel. Fix suggestion by Keiki SATOH...

* Fix CDDA and VCD modules for Mac OS X Intel. Fix suggestion by Keiki SATOH aka demo-n <demo-n at users dot sourceforgedot net>.
parent 13c581af
......@@ -233,7 +233,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
return 0;
}
i_descriptors = darwin_getNumberOfDescriptors( pTOC );
i_descriptors = CDTOCGetDescriptorCount( pTOC );
i_tracks = darwin_getNumberOfTracks( pTOC, i_descriptors );
if( pp_sectors )
......@@ -252,7 +252,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
pTrackDescriptors = pTOC->descriptors;
for( i_tracks = 0, i = 0; i <= i_descriptors; i++ )
for( i_tracks = 0, i = 0; i < i_descriptors; i++ )
{
track = pTrackDescriptors[i].point;
......@@ -1056,26 +1056,6 @@ static CDTOC *darwin_getTOC( vlc_object_t * p_this, const vcddev_t *p_vcddev )
return( pTOC );
}
/****************************************************************************
* darwin_getNumberOfDescriptors: get number of descriptors in TOC
****************************************************************************/
static int darwin_getNumberOfDescriptors( CDTOC *pTOC )
{
int i_descriptors;
/* get TOC length */
i_descriptors = pTOC->length;
/* remove the first and last session */
i_descriptors -= ( sizeof(pTOC->sessionFirst) +
sizeof(pTOC->sessionLast) );
/* divide the length by the size of a single descriptor */
i_descriptors /= sizeof(CDTOCDescriptor);
return( i_descriptors );
}
/****************************************************************************
* darwin_getNumberOfTracks: get number of tracks in TOC
****************************************************************************/
......@@ -1083,11 +1063,11 @@ static int darwin_getNumberOfTracks( CDTOC *pTOC, int i_descriptors )
{
u_char track;
int i, i_tracks = 0;
CDTOCDescriptor *pTrackDescriptors;
CDTOCDescriptor *pTrackDescriptors = NULL;
pTrackDescriptors = pTOC->descriptors;
pTrackDescriptors = (CDTOCDescriptor *)pTOC->descriptors;
for( i = i_descriptors; i >= 0; i-- )
for( i = i_descriptors; i > 0; i-- )
{
track = pTrackDescriptors[i].point;
......
......@@ -206,7 +206,6 @@ static void CloseVCDImage( vlc_object_t *, struct vcddev_s * );
#if defined( __APPLE__ )
static CDTOC *darwin_getTOC( vlc_object_t *, const struct vcddev_s * );
static int darwin_getNumberOfDescriptors( CDTOC * );
static int darwin_getNumberOfTracks( CDTOC *, int );
#elif defined( WIN32 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment