CDImage: Use track's control instead of last track's control for pregap

This commit is contained in:
Connor McLaughlin 2020-03-30 00:05:16 +10:00
parent 02f67a801e
commit 7ecac6dbcf
2 changed files with 4 additions and 12 deletions

View file

@ -101,9 +101,6 @@ bool CDImageCHD::Open(const char* filename)
u32 disc_lba = 0;
u64 disc_frame = 0;
// "last track" subchannel q - used for the pregap
SubChannelQ::Control last_track_control{};
// for each track..
int num_tracks = 0;
for (;;)
@ -178,7 +175,7 @@ bool CDImageCHD::Open(const char* filename)
pregap_index.track_number = track_num;
pregap_index.index_number = 0;
pregap_index.mode = mode.value();
pregap_index.control.bits = (track_num > 1) ? last_track_control.bits : control.bits;
pregap_index.control.bits = control.bits;
pregap_index.is_pregap = true;
if (pregap_in_file)
@ -203,7 +200,6 @@ bool CDImageCHD::Open(const char* filename)
// add the track itself
m_tracks.push_back(Track{static_cast<u32>(track_num), disc_lba, static_cast<u32>(m_indices.size()),
static_cast<u32>(frames), mode.value(), control});
last_track_control.bits = control.bits;
// how many indices in this track?
Index index = {};

View file

@ -66,9 +66,6 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
u32 disc_lba = 0;
// "last track" subchannel q - used for the pregap
SubChannelQ::Control last_track_control{};
// for each track..
const int num_tracks = cd_get_ntrack(m_cd);
for (int track_num = 1; track_num <= num_tracks; track_num++)
@ -138,7 +135,7 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
pregap_index.track_number = track_num;
pregap_index.index_number = 0;
pregap_index.mode = mode;
pregap_index.control.bits = (track_num > 1) ? last_track_control.bits : control.bits;
pregap_index.control.bits = control.bits;
pregap_index.is_pregap = true;
if (pregap_in_file)
{
@ -153,9 +150,8 @@ bool CDImageCueSheet::OpenAndParse(const char* filename)
}
// add the track itself
m_tracks.push_back(
Track{static_cast<u32>(track_num), disc_lba, static_cast<u32>(m_indices.size()), static_cast<u32>(track_length)});
last_track_control.bits = control.bits;
m_tracks.push_back(Track{static_cast<u32>(track_num), disc_lba, static_cast<u32>(m_indices.size()),
static_cast<u32>(track_length), mode, control});
// how many indices in this track?
Index last_index;