Skip to content

Commit

Permalink
Add an option to skip the TOC check on refine (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sazpaimon authored Jul 7, 2024
1 parent 3d6dc76 commit 99ab200
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cd/cd_dump.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,12 @@ export bool redumper_dump_cd(Context &ctx, const Options &options, bool refine)
// compare disc / file TOC to make sure it's the same disc
if(refine)
{
std::vector<uint8_t> toc_buffer_file = read_vector(toc_path);
if(toc_buffer != toc_buffer_file)
throw_line("disc / file TOC don't match, refining from a different disc?");
if(!options.force_refine)
{
std::vector<uint8_t> toc_buffer_file = read_vector(toc_path);
if(toc_buffer != toc_buffer_file)
throw_line("disc / file TOC don't match, refining from a different disc?");
}
}
// store TOC
else
Expand Down
2 changes: 1 addition & 1 deletion cd/cd_dump_new.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ TOC toc_process(Context &ctx, const Options &options, bool store)
write_vector(cdtext_path, cd_text_buffer);
}
// compare disc / file TOC to make sure it's the same disc
else
else if(!options.force_refine)
{
std::vector<uint8_t> toc_buffer_file = read_vector(toc_path);
if(toc_buffer != toc_buffer_file)
Expand Down
2 changes: 1 addition & 1 deletion dvd/dvd_dump.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export bool redumper_dump_dvd(Context &ctx, const Options &options, DumpMode dum
}
}
// compare physical structures to stored to make sure it's the same disc
else
else if(!options.force_refine)
{
for(uint32_t i = 0; i < physical_structures.size(); ++i)
{
Expand Down
5 changes: 5 additions & 0 deletions options.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export struct Options
int dump_read_size;
bool overread_leadout;
bool force_unscrambled;
bool force_refine;


Options(int argc, const char *argv[])
Expand Down Expand Up @@ -90,6 +91,7 @@ export struct Options
, dump_read_size(32)
, overread_leadout(false)
, force_unscrambled(false)
, force_refine(false)
{
for(int i = 1; i < argc; ++i)
arguments += str_quoted_if_space(argv[i]) + " ";
Expand Down Expand Up @@ -232,6 +234,8 @@ export struct Options
overread_leadout = true;
else if(key == "--force-unscrambled")
force_unscrambled = true;
else if(key == "--force-refine")
force_refine = true;
// unknown option
else
{
Expand Down Expand Up @@ -334,6 +338,7 @@ export struct Options
LOG("\t--dump-read-size=VALUE \tnumber of sectors to read at once on initial dump, DVD only (default: {})", dump_read_size);
LOG("\t--overread-leadout \tdo not limit lead-out to the first hundred sectors, read until drive returns SCSI error");
LOG("\t--force-unscrambled \tdo not attempt to read data sectors as audio (BE read method only)");
LOG("\t--force-refine \tdo not check TOC when refining a disc");
}
};

Expand Down

0 comments on commit 99ab200

Please sign in to comment.