chiark
/
gitweb
/
~mdw
/
dvdrip
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a862559
)
dvd-sector-copy.c: Don't dump fake-bad-block search if no bad blocks.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 18 Feb 2022 22:59:00 +0000
(22:59 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 18 Feb 2022 23:00:54 +0000
(23:00 +0000)
dvd-sector-copy.c
patch
|
blob
|
blame
|
history
diff --git
a/dvd-sector-copy.c
b/dvd-sector-copy.c
index 98ee8ec83881c590cd4f9f8d6e760ce09e74a1df..5caac23131087a443ba4574ce0c6eb016a5df40d 100644
(file)
--- a/
dvd-sector-copy.c
+++ b/
dvd-sector-copy.c
@@
-409,30
+409,31
@@
static ssize_t read_sectors(secaddr pos, void *buf, secaddr want)
struct badblock *bad, *best;
unsigned char *p = buf;
struct badblock *bad, *best;
unsigned char *p = buf;
- best = 0; lo = 0; hi = badblocks.n;
+ if (badblocks.n) {
+ best = 0; lo = 0; hi = badblocks.n;
#ifdef DEBUG
#ifdef DEBUG
- clear_progress();
- printf(";; searching badblocks for %"PRIuSEC" .. %"PRIuSEC"\n",
- pos, pos + want);
+
debug_
clear_progress();
+
printf(";; searching badblocks for %"PRIuSEC" .. %"PRIuSEC"\n",
+
pos, pos + want);
#endif
#endif
- while (lo < hi) {
- mid = lo + (hi - lo)/2; bad = &badblocks.v[mid];
+
while (lo < hi) {
+
mid = lo + (hi - lo)/2; bad = &badblocks.v[mid];
#ifdef DEBUG
#ifdef DEBUG
- printf(";; try %zu (%"PRIuSEC" .. %"PRIuSEC")... ",
- mid, bad->start, bad->end);
+
printf(";; try %zu (%"PRIuSEC" .. %"PRIuSEC")... ",
+
mid, bad->start, bad->end);
#endif
#endif
- if (pos < bad->start) { D( printf("high\n"); ) best = bad; hi = mid; }
- else if (pos >= bad->end) { D( printf("low\n"); ) lo = mid + 1; }
- else { D( printf("match!\n"); ) errno = EIO; return (-1); }
- }
+
if (pos < bad->start) { D( printf("high\n"); ) best = bad; hi = mid; }
+
else if (pos >= bad->end) { D( printf("low\n"); ) lo = mid + 1; }
+
else { D( printf("match!\n"); ) errno = EIO; return (-1); }
+
}
#ifdef DEBUG
#ifdef DEBUG
- if (best)
- printf(";; next is %"PRIuSEC" .. %"PRIuSEC"\n",
- best->start, best->end);
+
if (best)
+
printf(";; next is %"PRIuSEC" .. %"PRIuSEC"\n",
+
best->start, best->end);
#endif
#endif
- if (best && pos + want > best->start)
- { want = best->start - pos; fakeerr = EIO; }
-
+
if (best && pos + want > best->start)
+
{ want = best->start - pos; fakeerr = EIO; }
+ }
done = 0;
while (want) {
if (vob)
done = 0;
while (want) {
if (vob)