diff options
Diffstat (limited to 'lib/cdutils.cpp')
-rw-r--r-- | lib/cdutils.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
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 <stdio.h> #include <string.h> @@ -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; } |