dvdrip
2 years agodvd-sector-copy.c: Use the correct character to match comments.
Mark Wooding [Sat, 19 Feb 2022 15:23:04 +0000 (15:23 +0000)]
dvd-sector-copy.c: Use the correct character to match comments.

Oops.

2 years agosort-badblocks: Another handy testing utility.
Mark Wooding [Sat, 19 Feb 2022 11:54:20 +0000 (11:54 +0000)]
sort-badblocks: Another handy testing utility.

2 years agodvd-sector-copy.c: Limit `recovery_read' return value to length requested.
Mark Wooding [Sat, 19 Feb 2022 11:53:22 +0000 (11:53 +0000)]
dvd-sector-copy.c: Limit `recovery_read' return value to length requested.

Otherwise the caller gets properly confused.

2 years agodvd-sector-copy.c: Add more debugging about the recovery algorithm.
Mark Wooding [Sat, 19 Feb 2022 11:53:06 +0000 (11:53 +0000)]
dvd-sector-copy.c: Add more debugging about the recovery algorithm.

2 years agodvdrip-upload: Make script sexecutable, like it should be.
Mark Wooding [Sat, 19 Feb 2022 09:49:52 +0000 (09:49 +0000)]
dvdrip-upload: Make script sexecutable, like it should be.

2 years agodvd-sector-copy.c: Secret option to dump the exact bad sectors encountered.
Mark Wooding [Sat, 19 Feb 2022 02:02:24 +0000 (02:02 +0000)]
dvd-sector-copy.c: Secret option to dump the exact bad sectors encountered.

I don't think this one quite works properly yet.

2 years agodvd-sector-copy.c: Include file-relative information in bad-blocks file.
Mark Wooding [Sat, 19 Feb 2022 02:01:26 +0000 (02:01 +0000)]
dvd-sector-copy.c: Include file-relative information in bad-blocks file.

Also, tolerate these comments when reading them back in.

2 years agodvd-sector-copy.c: Read into the correct part of the buffer. Again.
Mark Wooding [Sat, 19 Feb 2022 02:00:28 +0000 (02:00 +0000)]
dvd-sector-copy.c: Read into the correct part of the buffer.  Again.

2 years agodvd-sector-copy.c: Remove broken field-width specifier.
Mark Wooding [Sat, 19 Feb 2022 01:59:03 +0000 (01:59 +0000)]
dvd-sector-copy.c: Remove broken field-width specifier.

I failed to include space for the decimal point and fraction, so it
didn't actually do anything.  And it turns out that I'm happy with it
like this.

2 years agodvd-sector-copy.c: Factor out some file-hacking machinery.
Mark Wooding [Sat, 19 Feb 2022 01:58:34 +0000 (01:58 +0000)]
dvd-sector-copy.c: Factor out some file-hacking machinery.

2 years agodvdrip: Collect together bad-blocks lists from repeated runs.
Mark Wooding [Sat, 19 Feb 2022 01:55:28 +0000 (01:55 +0000)]
dvdrip: Collect together bad-blocks lists from repeated runs.

2 years agocheckimg, distill: A couple of scripts useful for testing and debugging.
Mark Wooding [Fri, 18 Feb 2022 23:01:13 +0000 (23:01 +0000)]
checkimg, distill: A couple of scripts useful for testing and debugging.

2 years agodvd-sector-copy.c: Leave progress report visible before debugging.
Mark Wooding [Fri, 18 Feb 2022 23:00:18 +0000 (23:00 +0000)]
dvd-sector-copy.c: Leave progress report visible before debugging.

2 years agodvd-sector-copy.c: Fix formatting for debugging code.
Mark Wooding [Fri, 18 Feb 2022 22:58:34 +0000 (22:58 +0000)]
dvd-sector-copy.c: Fix formatting for debugging code.

2 years agodvd-sector-copy.c: Dump buffer after final recovery.
Mark Wooding [Fri, 18 Feb 2022 23:00:00 +0000 (23:00 +0000)]
dvd-sector-copy.c: Dump buffer after final recovery.

2 years agodvd-sector-copy.c: Don't dump fake-bad-block search if no bad blocks.
Mark Wooding [Fri, 18 Feb 2022 22:59:00 +0000 (22:59 +0000)]
dvd-sector-copy.c: Don't dump fake-bad-block search if no bad blocks.

2 years agodvd-sector-copy.c: Fix final recovery.
Mark Wooding [Fri, 18 Feb 2022 22:57:13 +0000 (22:57 +0000)]
dvd-sector-copy.c: Fix final recovery.

Write this the other way around, because it's easier to read that way.
And then notice that it's broken because it doesn't actually set the
return value properly.

2 years agodvd-sector-copy.c: Write new data into the correct part of the buffer.
Mark Wooding [Fri, 18 Feb 2022 22:55:57 +0000 (22:55 +0000)]
dvd-sector-copy.c: Write new data into the correct part of the buffer.

The debugging message had the right value, which made this annoyingly
hard to track down.

2 years agodvd-sector-copy.c: Check more carefully for overflow conditions.
Mark Wooding [Fri, 18 Feb 2022 22:55:33 +0000 (22:55 +0000)]
dvd-sector-copy.c: Check more carefully for overflow conditions.

2 years agodvd-sector-copy.c: Check `n' nonnegative before comparing with unsigned.
Mark Wooding [Fri, 18 Feb 2022 22:54:19 +0000 (22:54 +0000)]
dvd-sector-copy.c: Check `n' nonnegative before comparing with unsigned.

Otherwise it might be coerced to unsigned, at which point the comparison
means something completely different.

2 years agodvd-sector-copy.c: Adjust the base position when shifting.
Mark Wooding [Fri, 18 Feb 2022 22:51:28 +0000 (22:51 +0000)]
dvd-sector-copy.c: Adjust the base position when shifting.

Fixes stupid bug.

2 years agodvd-sector-copy.c: Fix formatting for `ssize_t'.
Mark Wooding [Fri, 18 Feb 2022 22:50:16 +0000 (22:50 +0000)]
dvd-sector-copy.c: Fix formatting for `ssize_t'.

2 years agodvd-sector-copy.c: Rewrite the bad-sector recovery machinery.
Mark Wooding [Fri, 18 Feb 2022 19:00:48 +0000 (19:00 +0000)]
dvd-sector-copy.c: Rewrite the bad-sector recovery machinery.

It's now much more aggressive about skipping good sectors squished
between bad ones.

2 years agodvd-sector-copy.c: Extract the post-recovery code into a function.
Mark Wooding [Fri, 18 Feb 2022 18:58:47 +0000 (18:58 +0000)]
dvd-sector-copy.c: Extract the post-recovery code into a function.

The `goto' is ugly.

2 years agodvd-sector-copy.c: Sink `report_bad_blocks_progress' towards recovery.
Mark Wooding [Fri, 18 Feb 2022 18:54:54 +0000 (18:54 +0000)]
dvd-sector-copy.c: Sink `report_bad_blocks_progress' towards recovery.

2 years agodvd-sector-copy.c: Make `read_sectors' more persistent after short reads.
Mark Wooding [Fri, 18 Feb 2022 18:50:27 +0000 (18:50 +0000)]
dvd-sector-copy.c: Make `read_sectors' more persistent after short reads.

It now continues trying to read until it gets an error, end-of-file, or
it completes the task requested of it.  For consistency, we must also
report an error after a short read forced by a synthetic bad sector,
which requires a little additional machinery.

2 years agodvd-sector-copy.c: Move `i' to the debug-only variables block.
Mark Wooding [Fri, 18 Feb 2022 18:46:13 +0000 (18:46 +0000)]
dvd-sector-copy.c: Move `i' to the debug-only variables block.

2 years agodvd-sector-copy.c: Split bad-block recovery out into its own function.
Mark Wooding [Thu, 17 Feb 2022 00:16:58 +0000 (00:16 +0000)]
dvd-sector-copy.c: Split bad-block recovery out into its own function.

2 years agodvd-sector-copy.c: Add machinery for installing pretend bad sectors.
Mark Wooding [Wed, 16 Feb 2022 23:37:50 +0000 (23:37 +0000)]
dvd-sector-copy.c: Add machinery for installing pretend bad sectors.

For testing the recovery algorithm(s).

2 years agodvd-sector-copy.c: Force return to start of line on progress output.
Mark Wooding [Wed, 16 Feb 2022 21:20:10 +0000 (21:20 +0000)]
dvd-sector-copy.c: Force return to start of line on progress output.

2 years agodvd-sector-copy.c: Merge adjacent retry ranges when reading from a file.
Mark Wooding [Wed, 16 Feb 2022 21:19:42 +0000 (21:19 +0000)]
dvd-sector-copy.c: Merge adjacent retry ranges when reading from a file.

2 years agodvd-sector-copy.c, dvdrip: Make input and output files positional args.
Mark Wooding [Wed, 16 Feb 2022 21:15:22 +0000 (21:15 +0000)]
dvd-sector-copy.c, dvdrip: Make input and output files positional args.

They're not really optional.

2 years agodvd-sector-copy.c: Hoist out the common sector-range parsing machinery.
Mark Wooding [Wed, 16 Feb 2022 21:13:46 +0000 (21:13 +0000)]
dvd-sector-copy.c: Hoist out the common sector-range parsing machinery.

2 years agodvd-sector-copy.c: Make `outfd' be global variable.
Mark Wooding [Wed, 16 Feb 2022 21:10:54 +0000 (21:10 +0000)]
dvd-sector-copy.c: Make `outfd' be global variable.

2 years agodvd-sector-copy.c: Hoist `carefully_write' up near the system utilities.
Mark Wooding [Wed, 16 Feb 2022 21:09:15 +0000 (21:09 +0000)]
dvd-sector-copy.c: Hoist `carefully_write' up near the system utilities.

2 years agodvd-sector-copy.c: Split up the things which used to be in `struct source'.
Mark Wooding [Wed, 16 Feb 2022 18:55:24 +0000 (18:55 +0000)]
dvd-sector-copy.c: Split up the things which used to be in `struct source'.

2 years agodvd-sector-copy.c: Eliminate `struct source'; just make the things global.
Mark Wooding [Wed, 16 Feb 2022 18:53:16 +0000 (18:53 +0000)]
dvd-sector-copy.c: Eliminate `struct source'; just make the things global.

2 years agodvd-sector-copy.c: Reorder things in a more sensible way.
Mark Wooding [Wed, 16 Feb 2022 18:19:11 +0000 (18:19 +0000)]
dvd-sector-copy.c: Reorder things in a more sensible way.

2 years agodvd-sector-copy.c: Introduce `moan' function for printing warnings.
Mark Wooding [Wed, 16 Feb 2022 18:02:16 +0000 (18:02 +0000)]
dvd-sector-copy.c: Introduce `moan' function for printing warnings.

2 years agodvd-sector-copy.c: Introduce type alias and print macro for sector numbers.
Mark Wooding [Wed, 16 Feb 2022 18:00:31 +0000 (18:00 +0000)]
dvd-sector-copy.c: Introduce type alias and print macro for sector numbers.

2 years agodvd-sector-copy.c: Support reading from a regular file.
Mark Wooding [Wed, 16 Feb 2022 10:10:05 +0000 (10:10 +0000)]
dvd-sector-copy.c: Support reading from a regular file.

This will be useful for testing.  I hope.

2 years agodvd-sector-copy.c: Order `STOP' before `WRITE'.
Mark Wooding [Wed, 16 Feb 2022 10:08:06 +0000 (10:08 +0000)]
dvd-sector-copy.c: Order `STOP' before `WRITE'.

The bad-block parsers already filter out empty regions, so they won't
cause a problem.  And this way we don't reject groups of adjacent bad
blocks, though we don't actually merge them as we probably should.

2 years agobuild: Build locally and install in the usual way.
Mark Wooding [Wed, 16 Feb 2022 10:06:48 +0000 (10:06 +0000)]
build: Build locally and install in the usual way.

Accessing these programs over NFS is more annoying than useful, so do
things the old-fashioned way instead.

2 years agodvdrip-upload: Inhibit the fancy rsync algorithm when copying.
Mark Wooding [Tue, 15 Feb 2022 10:11:12 +0000 (10:11 +0000)]
dvdrip-upload: Inhibit the fancy rsync algorithm when copying.

On my system, at least, it actually slows copying down by a factor of at
least two.

2 years agodvdrip: Ring the bell when the job is done.
Mark Wooding [Tue, 15 Feb 2022 10:10:58 +0000 (10:10 +0000)]
dvdrip: Ring the bell when the job is done.

Wake me up.

2 years agodvd-sector-copy.c: Show overall progress if we're simply continuing.
Mark Wooding [Tue, 15 Feb 2022 10:07:54 +0000 (10:07 +0000)]
dvd-sector-copy.c: Show overall progress if we're simply continuing.

If we're supposed to write a single region extending to the end of the
disc then show the percentage completion in terms of the absolute
position in the disc rather than as a percentage of the number of
sectors we're supposed to copy.  This makes the percentage shown easier
to relate to that displayed by a previous interrupted operation.

2 years agodvdrip: Cope with `/' in the output name.
Mark Wooding [Mon, 7 Feb 2022 22:29:51 +0000 (22:29 +0000)]
dvdrip: Cope with `/' in the output name.

2 years agoInitial commit.
Mark Wooding [Mon, 7 Feb 2022 21:00:16 +0000 (21:00 +0000)]
Initial commit.