From 0b266c95523f944e62acf9251eb27450a8d73a04 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 8 Dec 2003 15:12:56 +0000 Subject: LUA everywhere! Wheee! --- lib/cdutils.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/cdutils.cpp') diff --git a/lib/cdutils.cpp b/lib/cdutils.cpp index b3468e7..ba830f6 100644 --- a/lib/cdutils.cpp +++ b/lib/cdutils.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: cdutils.cpp,v 1.16 2003-12-04 00:57:35 pixel Exp $ */ +/* $Id: cdutils.cpp,v 1.17 2003-12-08 15:12:57 pixel Exp $ */ #include #include @@ -805,12 +805,22 @@ cdfile::cdfile(cdutils * _cd, const cdutils::DirEntry * d, int _mode) : Handle(- } cdfile::cdfile(cdutils * _cd, int _sector, ssize_t _size, int _mode) : Handle(-1), cd(_cd), sector(_sector), mode(_mode), size(_size), name("raw reading") { - if (_size == -1) { - size = 0; - } + Byte datas[2352]; + bool eof; + if (mode == GUESS) { mode = cd->guess_type(sector); } + if (_size == -1) { + size = 0; + if ((mode == MODE2_FORM1) || (mode == MODE2_FORM2)) { + do { + cd->read_sector(datas, MODE_RAW, sector + size++); + eof = datas[18] & 0x80; + } while (!eof); + size *= sec_sizes[mode]; + } + } dir = 0; itell = 0; } -- cgit v1.2.3