Adjustment for reading audio cd. Also break out MMC stuff a little

bit better.
This commit is contained in:
rocky
2003-09-18 13:32:19 +00:00
parent 3b2e52e8fc
commit 09259e044e

View File

@@ -1,5 +1,5 @@
/* /*
$Id: _cdio_bincue.c,v 1.25 2003/09/14 06:24:09 rocky Exp $ $Id: _cdio_bincue.c,v 1.26 2003/09/18 13:32:19 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
@@ -28,7 +28,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: _cdio_bincue.c,v 1.25 2003/09/14 06:24:09 rocky Exp $"; static const char _rcsid[] = "$Id: _cdio_bincue.c,v 1.26 2003/09/18 13:32:19 rocky Exp $";
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
@@ -458,15 +458,27 @@ _cdio_read_audio_sector (void *user_data, void *data, lsn_t lsn)
_cdio_init (_obj); _cdio_init (_obj);
ret = cdio_stream_seek (_obj->gen.data_source, lsn * CDIO_CD_FRAMESIZE_RAW, /* Why the adjustment of 272, I don't know. It seems to work though */
SEEK_SET); if (lsn != 0) {
ret = cdio_stream_seek (_obj->gen.data_source,
(lsn * CDIO_CD_FRAMESIZE_RAW) - 272, SEEK_SET);
if (ret!=0) return ret; if (ret!=0) return ret;
ret = cdio_stream_read (_obj->gen.data_source, data, CDIO_CD_FRAMESIZE_RAW, ret = cdio_stream_read (_obj->gen.data_source, data,
1); CDIO_CD_FRAMESIZE_RAW, 1);
if (ret==0) return ret; } else {
/* We need to pad out the first 272 bytes with 0's */
bzero(data, 272);
return 0; ret = cdio_stream_seek (_obj->gen.data_source, 0, SEEK_SET);
if (ret!=0) return ret;
ret = cdio_stream_read (_obj->gen.data_source, (uint8_t *) data+272,
CDIO_CD_FRAMESIZE_RAW - 272, 1);
}
return ret;
} }
/*! /*!