summaryrefslogtreecommitdiff
path: root/lib/cdreader.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-08-25 18:43:02 +0000
committerPixel <Pixel>2002-08-25 18:43:02 +0000
commit9abf17dd5aa9d367b90e3461c52f45464b718b2d (patch)
tree8fcd8ed7e80029a383c792b1f0a48ed82457fc1a /lib/cdreader.cpp
parente2abcc08b4362b4d3769119d302b13409162d607 (diff)
Bleh
Diffstat (limited to 'lib/cdreader.cpp')
-rw-r--r--lib/cdreader.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/cdreader.cpp b/lib/cdreader.cpp
index 5363251..f24e54b 100644
--- a/lib/cdreader.cpp
+++ b/lib/cdreader.cpp
@@ -78,13 +78,16 @@ ssize_t cdreader::read(void *buf, size_t count) throw (GeneralException) {
char sector[CD_FRAMESIZE_RAW];
size_t r = count;
+ fprintf(stderr, "Asked to cd-read %i bytes at %i\n", count, (int) itell);
+
size_t remain = itell % CD_FRAMESIZE_RAW;
+ fprintf(stderr, "Seeking to sector %li, to read at %i\n", itell / CD_FRAMESIZE_RAW, (int) remain);
sectorseek(itell / CD_FRAMESIZE_RAW);
while (count > 0) {
size_t n = CD_FRAMESIZE_RAW - remain;
getsector(sector);
- bcopy(sector, ((char *) buf) + remain, MIN(n, count));
+ bcopy(sector + remain, buf, MIN(n, count));
count -= n;
remain = 0;
}
@@ -97,8 +100,6 @@ void cdreader::getsector(void *buf, int sec) throw (GeneralException) {
if (sec >= 0)
sector = sec;
- fprintf(stderr, "Reading sector %i\n", sector);
-
sector += 150;
msf->cdmsf_min0 = sector /CD_SECS /CD_FRAMES;