First post, by gilgamesh
Hello,
I think I fond a logical bug in src/dos/cdrom_image.cpp.
When I save a whole CD with data and audio tracks in one big BIN-image (for mounting a BIN/CUE comination) everything works just fine. CDROM_Interface_Image::GetAudioTrackInfo returns the correct offset (minutes, seconds, frames) for each audio track. When I specify compressed single files for each track via the MP3 tag in my cue-file, then the offsets are a mess.
I think that dosbox calculates the offsets by using the size in bytes of each file, which doesn't make sense with compressed audio tracks (see CDROM_Interface_Image::AddTrack):
/*...*/
// current track uses a different file as the previous track
} else {
int tmp = prev.file->getLength() - prev.skip;
prev.length = tmp / prev.sectorSize;
if (tmp % prev.sectorSize != 0) prev.length++; // padding
curr.start += prev.start + prev.length + currPregap;
curr.skip = skip * curr.sectorSize;
shift += prev.start + prev.length;
totalPregap = currPregap;
}
/*...*/
It should rather retrieve the length from SDL_audio or use the data explicitly specified via the INDEX tag which is processed in dos/cdrom_image.cpp: CDROM_Interface_Image::LoadCueSheet.
I know of at least one game (Realms of Arkania3 / Das schwarze Auge 3) which checks the offsets before playing them.
Are my thoughts concerning this right and does anybody know of a hack to get around this problem?