dvd-sector-copy.c (find_good_sector): Update the progress display later.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 Apr 2022 16:29:23 +0000 (17:29 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Apr 2022 16:29:23 +0000 (17:29 +0100)
In particular, after clearing the display for debugging rather than
before.

dvd-sector-copy.c

index a303239..73e068a 100644 (file)
@@ -727,7 +727,6 @@ static ssize_t find_good_sector(secaddr *pos_inout, secaddr end,
 
   bad_lo = pos; bad_hi = pos + 1;
   for (;;) {
-    report_bad_blocks_progress(bad_hi, errno);
 #ifdef DEBUG
     progress_clear(&progress);
     printf(";; bounding bad-block region: "
@@ -740,6 +739,7 @@ static ssize_t find_good_sector(secaddr *pos_inout, secaddr end,
       recovered(bad_lo, end); *pos_inout = end;
       return (0);
     }
+    report_bad_blocks_progress(bad_hi, errno);
     step = (step_factor - 1)*(bad_hi - bad_lo);
     if (step < step_min) step = step_min;
     if (step_max && step > step_max) step = step_max;
@@ -758,13 +758,13 @@ static ssize_t find_good_sector(secaddr *pos_inout, secaddr end,
 
   good = pos;
   while (good > bad_hi) {
-    report_bad_blocks_progress(bad_hi, errno);
 #ifdef DEBUG
     progress_clear(&progress);
     printf(";; limiting bad-block region: "
           "%"PRIuSEC" ..%"PRIuSEC".. %"PRIuSEC" ..%"PRIuSEC".. %"PRIuSEC"\n",
           bad_lo, bad_hi - bad_lo, bad_hi, good - bad_hi, good);
 #endif
+    report_bad_blocks_progress(bad_hi, errno);
     pos = bad_hi + (good - bad_hi)/2;
     step = pos - bad_lo;
     want = run_length_wanted(pos, step, end);