From 7bb3ffa4929cca18e581787aa93770d672e1c413 Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Sun, 8 Feb 2026 19:03:22 -0500 Subject: [PATCH 1/4] cd-paranoia.c: Add --all-sectors option Rips all sectors without specifying a span argument. --- src/cd-paranoia.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/cd-paranoia.c b/src/cd-paranoia.c index e5df934..f33cdaa 100644 --- a/src/cd-paranoia.c +++ b/src/cd-paranoia.c @@ -566,10 +566,11 @@ static void callback(long int inpos, paranoia_cb_mode_t function) { #endif /* !TRACE_PARANOIA */ static const char optstring[] = - "aBcCd:eEfFg:k:hi:l:L:Am:n:o:O:pqQrRsS:Tt:VvwWx:XYZz::"; + "aBcCd:eEfFg:k:hi:l:L:AMm:n:o:O:pqQrRsS:Tt:VvwWx:XYZz::"; static const struct option options[] = { {"abort-on-skip", no_argument, NULL, 'X'}, + {"all-sectors", no_argument, NULL, 'M'}, {"analyze-drive", no_argument, NULL, 'A'}, {"batch", no_argument, NULL, 'B'}, {"disable-extra-paranoia", no_argument, NULL, 'Y'}, @@ -692,6 +693,7 @@ int main(int argc, char *argv[]) { int output_endian = 0; /* -1=host, 0=little, 1=big */ int query_only = 0; int batch = 0; + int all_sectors = 0; int run_cache_test = 0; long int force_cdrom_overlap = -1; long int force_cdrom_sectors = -1; @@ -863,6 +865,9 @@ int main(int argc, char *argv[]) { case 'E': force_overread = 1; break; + case 'M': + all_sectors = 1; + break; default: usage(stderr); exit(1); @@ -1178,6 +1183,10 @@ int main(int argc, char *argv[]) { long batch_last; int batch_track; + if (all_sectors) + /* explicitly turn off span, we're grabbing everything */ + span = 0; + if (span) { /* look for the hyphen */ char *span2 = strchr(span, '-'); @@ -1223,13 +1232,15 @@ int main(int argc, char *argv[]) { { /* Check for errors on lsn before getting track */ - if (i_first_lsn < 0) { - report("Error on begin of span: %li. Aborting.\n\n", i_first_lsn); - exit(1); - } - if (i_last_lsn < 0) { - report("Error on end of span: %li. Aborting.\n\n", i_last_lsn); - exit(1); + if (span) { + if (i_first_lsn < 0) { + report("Error on begin of span: %li. Aborting.\n\n", i_first_lsn); + exit(1); + } + if (i_last_lsn < 0) { + report("Error on end of span: %li. Aborting.\n\n", i_last_lsn); + exit(1); + } } int track1 = cdda_sector_gettrack(d, i_first_lsn); @@ -1303,7 +1314,12 @@ int main(int argc, char *argv[]) { while (cursor <= i_last_lsn) { char outfile_name[PATH_MAX]; - if (batch) { + if (all_sectors) { + batch_track = cdda_disc_firstsector(d); + batch_last = cdda_disc_lastsector(d); + if (batch_last > i_last_lsn) + batch_last = i_last_lsn; + } else if (batch) { batch_first = cursor; batch_track = cdda_sector_gettrack(d, cursor - toc_offset); batch_last = cdda_track_lastsector(d, batch_track) + toc_offset; From 768e8a8daef68b0e609454be6813ed6ce2eb116a Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Sun, 8 Feb 2026 19:15:23 -0500 Subject: [PATCH 2/4] usage.txt.in: add information about --all-sectors/-M option --- src/usage.txt.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/usage.txt.in b/src/usage.txt.in index 4c8a49b..1c4a842 100644 --- a/src/usage.txt.in +++ b/src/usage.txt.in @@ -64,6 +64,7 @@ OPTIONS: -X --abort-on-skip : abort on imperfect reads/skips -x --test-flags=mask : simulate CD-reading errors of ilk-mask n mask & 0x10 - simulate underrun errors + -M --all-sectors : copies all sectors OUTPUT SMILIES: :-) Normal operation, low/no jitter From 7261cdcfa9033598d83463e55dd1054042c766b2 Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Mon, 9 Feb 2026 06:23:12 -0500 Subject: [PATCH 3/4] Clarify usage of all-sectors in comparison to span arguments --- src/cd-paranoia.c | 5 ++++- src/usage.txt.in | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cd-paranoia.c b/src/cd-paranoia.c index f33cdaa..5508b24 100644 --- a/src/cd-paranoia.c +++ b/src/cd-paranoia.c @@ -1183,9 +1183,12 @@ int main(int argc, char *argv[]) { long batch_last; int batch_track; - if (all_sectors) + if (all_sectors) { /* explicitly turn off span, we're grabbing everything */ + if (span) + report("Warning: all-sectors requested, overriding span"); span = 0; + } if (span) { /* look for the hyphen */ diff --git a/src/usage.txt.in b/src/usage.txt.in index 1c4a842..561172a 100644 --- a/src/usage.txt.in +++ b/src/usage.txt.in @@ -64,7 +64,7 @@ OPTIONS: -X --abort-on-skip : abort on imperfect reads/skips -x --test-flags=mask : simulate CD-reading errors of ilk-mask n mask & 0x10 - simulate underrun errors - -M --all-sectors : copies all sectors + -M --all-sectors : copies all sectors, overrides span arguments OUTPUT SMILIES: :-) Normal operation, low/no jitter From dba9d5c7dd5cbd8e58bc4f4789318b97cf3435c5 Mon Sep 17 00:00:00 2001 From: Stephen Hutchinson Date: Wed, 11 Feb 2026 23:23:24 -0500 Subject: [PATCH 4/4] Cosmetic fix for readability --- src/cd-paranoia.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cd-paranoia.c b/src/cd-paranoia.c index 5508b24..a0160e4 100644 --- a/src/cd-paranoia.c +++ b/src/cd-paranoia.c @@ -1184,9 +1184,10 @@ int main(int argc, char *argv[]) { int batch_track; if (all_sectors) { - /* explicitly turn off span, we're grabbing everything */ if (span) report("Warning: all-sectors requested, overriding span"); + + /* explicitly turn off span, we're grabbing everything */ span = 0; }