From df4f6a0a5f55e52f625095280c602b63c9f2651c Mon Sep 17 00:00:00 2001 From: zakk4223 Date: Sat, 9 Jan 2021 03:06:33 -0500 Subject: [PATCH] Increment the LBA for both bin/cue and CHD audio reads. Fixes #324 (#326) Co-authored-by: Zakk --- support/megacd/megacdd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/megacd/megacdd.cpp b/support/megacd/megacdd.cpp index a6b2392..fba97c9 100644 --- a/support/megacd/megacdd.cpp +++ b/support/megacd/megacdd.cpp @@ -901,7 +901,6 @@ int cdd_t::ReadCDDA(uint8_t *buf) for(int i = 0; i < this->audioLength / 2352; i++) { mister_chd_read_sector(this->toc.chd_f, this->lba + this->toc.tracks[this->index].offset, 2352*i, 0, 2352, buf, this->chd_hunkbuf, &this->chd_hunknum); - this->lba++; } //CHD audio requires byteswap. There's probably a better way to do this... @@ -917,6 +916,7 @@ int cdd_t::ReadCDDA(uint8_t *buf) FileReadAdv(&this->toc.tracks[this->index].f, buf, this->audioLength); } + this->lba += (this->audioLength / 2352); return this->audioLength; }