i = lba % acdrom.buf_cnt;
slock_lock(acdrom.buf_lock);
if (lba == acdrom.buf_cache[i].lba) {
- if (!buf)
- buf = acdrom.buf_local;
- memcpy(buf, acdrom.buf_cache[i].buf, CD_FRAMESIZE_RAW);
+ if (buf)
+ memcpy(buf, acdrom.buf_cache[i].buf, CD_FRAMESIZE_RAW);
if (sub_buf)
memcpy(sub_buf, acdrom.buf_cache[i].buf_sub, SUB_FRAMESIZE);
ret = 1;
}
}
acdrom.do_prefetch = 0;
- if (!buf)
- buf = acdrom.buf_local;
if (g_cd_handle) {
if (buf_sub)
ret = rcdrom_readSub(g_cd_handle, lba, buf_sub);
// just forward to ISOreadTrack to avoid extra copying
return ISOreadTrack(time, NULL);
}
- return cdra_do_read(time, 0, NULL, NULL);
+ return cdra_do_read(time, 0, acdrom.buf_local, NULL);
}
int cdra_readCDDA(const unsigned char *time, void *buffer)