Skip to content

Commit

Permalink
intermediate lead-out derive fix
Browse files Browse the repository at this point in the history
  • Loading branch information
superg committed Dec 16, 2022
1 parent 3b980a8 commit bd045c6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion toc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,28 @@ TOC::TOC(const ChannelQ *subq, uint32_t sectors_count, int32_t lba_start)

void TOC::DeriveINDEX(const TOC &toc)
{
for(auto &s : sessions)
for(uint32_t i = 0; i < sessions.size(); ++i)
{
auto &s = sessions[i];
for(auto &t : s.tracks)
{
// don't update intermediate lead-in
if(t.track_number == bcd_decode(CD_LEADOUT_TRACK_NUMBER) && i + 1 < sessions.size())
continue;

for(auto const &toc_s : toc.sessions)
for(auto const &toc_t : toc_s.tracks)
{
if(t.track_number == toc_t.track_number)
{
t.indices = toc_t.indices;
break;
}
}
}
}


}


Expand Down

0 comments on commit bd045c6

Please sign in to comment.