dvdrip
2 years ago@@@ dvdrip-upload: change settings while i'm stealing someone else's internet mdw/cleanup
Mark Wooding [Fri, 15 Apr 2022 16:05:57 +0000 (17:05 +0100)]
@@@ dvdrip-upload: change settings while i'm stealing someone else's internet

2 years agodvdrip-upload: Add additional burbling around check sweeps.
Mark Wooding [Fri, 15 Apr 2022 16:05:34 +0000 (17:05 +0100)]
dvdrip-upload: Add additional burbling around check sweeps.

2 years agodvdrip-upload: Replace the signalling protocol with, err, signals.
Mark Wooding [Fri, 15 Apr 2022 16:04:16 +0000 (17:04 +0100)]
dvdrip-upload: Replace the signalling protocol with, err, signals.

No longer needs lockfiles.

2 years agodvdrip-upload: Add an option for setting the archive name.
Mark Wooding [Fri, 15 Apr 2022 15:59:21 +0000 (16:59 +0100)]
dvdrip-upload: Add an option for setting the archive name.

2 years agodvd-sector-copy.c: Make constants local to the only function which uses them.
Mark Wooding [Fri, 15 Apr 2022 15:58:21 +0000 (16:58 +0100)]
dvd-sector-copy.c: Make constants local to the only function which uses them.

2 years agodvd-sector-copy.c: Add nonlinear progress models.
Mark Wooding [Tue, 12 Apr 2022 21:05:24 +0000 (22:05 +0100)]
dvd-sector-copy.c: Add  nonlinear progress models.

The details are rather complicated, so they're explained in the
commentary.  It seems to work pretty well in practice, settling in
within 5% within a minute or two of starting to copy an OTP disc.

2 years agodvd-sector-copy.c: Add `-P' option to log progress state for later analysis.
Mark Wooding [Tue, 12 Apr 2022 21:03:08 +0000 (22:03 +0100)]
dvd-sector-copy.c: Add `-P' option to log progress state for later analysis.

This is intentionally undocumented.

2 years agodvd-sector-copy.c: Update progress data at event edge.
Mark Wooding [Tue, 12 Apr 2022 20:58:51 +0000 (21:58 +0100)]
dvd-sector-copy.c: Update progress data at event edge.

Don't just redisplay.  In particular, this forces output right at the
very beginning, before we read anything, which will be significant
soon.

2 years agodvd-sector-copy.c: Package up the moving-average machinery.
Mark Wooding [Tue, 12 Apr 2022 20:58:07 +0000 (21:58 +0100)]
dvd-sector-copy.c: Package up the moving-average machinery.

Now we can have more than one.

2 years agodvd-sector-copy.c: Add substantial commentary.
Mark Wooding [Sat, 9 Apr 2022 17:15:10 +0000 (18:15 +0100)]
dvd-sector-copy.c: Add substantial commentary.

And light reformatting.

2 years agodvd-sector-copy.c: Change the moving-average denominator computation.
Mark Wooding [Sat, 9 Apr 2022 17:08:05 +0000 (18:08 +0100)]
dvd-sector-copy.c: Change the moving-average denominator computation.

Rather than updating this using the geometric-series formula as before,
calculate it as (1 - β^t), incorporating the initial correction from
Wikipedia.  My testing suggests that this stabilizes rather more
quickly.

2 years agodvd-sector-copy.c (update_progress): Squish time delta calculation.
Mark Wooding [Sat, 9 Apr 2022 17:07:31 +0000 (18:07 +0100)]
dvd-sector-copy.c (update_progress): Squish time delta calculation.

2 years agodvd-sector-copy.c: Sink `#undef' for logically local macros to very end.
Mark Wooding [Sat, 9 Apr 2022 16:55:16 +0000 (17:55 +0100)]
dvd-sector-copy.c: Sink `#undef' for logically local macros to very end.

2 years agodvd-sector-copy.c: Sink debugging spew to the end of the `switch' arm.
Mark Wooding [Sat, 9 Apr 2022 16:54:50 +0000 (17:54 +0100)]
dvd-sector-copy.c: Sink debugging spew to the end of the `switch' arm.

2 years agodvd-sector-copy.c (main): Use `last' to track final event for fixup.
Mark Wooding [Sat, 9 Apr 2022 16:51:43 +0000 (17:51 +0100)]
dvd-sector-copy.c (main): Use `last' to track final event for fixup.

The `start' variable was doing double-duty, resulting in a possibly
erroneous value if the last event is `EV_WRITE', and a possibly
erroneous count of sectors.  Use `last' instead, because nothing else is
using this.

2 years agodvd-sector-copy.c (main): Sink progress setup to just before opening device.
Mark Wooding [Sat, 9 Apr 2022 16:46:11 +0000 (17:46 +0100)]
dvd-sector-copy.c (main): Sink progress setup to just before opening device.

2 years agodvd-sector-copy.c: Reformat an overly-long line.
Mark Wooding [Sat, 9 Apr 2022 16:43:54 +0000 (17:43 +0100)]
dvd-sector-copy.c: Reformat an overly-long line.

2 years agodvd-sector-copy.c (main): Add a flag to track retrying.
Mark Wooding [Sat, 9 Apr 2022 16:30:41 +0000 (17:30 +0100)]
dvd-sector-copy.c (main): Add a flag to track retrying.

Previously we'd try to determine whether retry was intended from whether
there are (begin/stop) events in the queue.  This is bad because we
might have tried to read an empty retry file, in which case we'd still
have no events, but the intend would clearly be to do nothing rather
than re-read the entire input disc.

2 years agodvd-sector-copy.c: Don't adjust a variable which is never spoken of again.
Mark Wooding [Sat, 9 Apr 2022 16:28:06 +0000 (17:28 +0100)]
dvd-sector-copy.c: Don't adjust a variable which is never spoken of again.

2 years agodvd-sector-copy.c: Fold loop initialization into the `for' satatement.
Mark Wooding [Sat, 9 Apr 2022 16:26:32 +0000 (17:26 +0100)]
dvd-sector-copy.c: Fold loop initialization into the `for' satatement.

2 years agodvd-sector-copy.c: Commute some operations.
Mark Wooding [Sat, 9 Apr 2022 12:51:01 +0000 (13:51 +0100)]
dvd-sector-copy.c: Commute some operations.

I think it makes slightly better sense this way.

2 years agodvd-sector-copy.c: Delete a redundant `else'.
Mark Wooding [Sat, 9 Apr 2022 12:50:19 +0000 (13:50 +0100)]
dvd-sector-copy.c: Delete a redundant `else'.

This will read better once the commentary is added.

2 years agodvd-sector-copy.c (emit): Update progress display after adding file progress.
Mark Wooding [Fri, 8 Apr 2022 17:54:57 +0000 (18:54 +0100)]
dvd-sector-copy.c (emit): Update progress display after adding file progress.

This will show the new progress, at the start of the file, immediately,
rather than showing an update without the file data just before the
first file.

2 years agodvd-sector-copy.c (find_good_sector): Use `good' rather than `bad_hi'.
Mark Wooding [Fri, 8 Apr 2022 17:50:34 +0000 (18:50 +0100)]
dvd-sector-copy.c (find_good_sector): Use `good' rather than `bad_hi'.

It should be the case that, if there's any difference at all, `good' is
earlier than `bad_hi', which will give us more good data.

2 years agodvd-sector-copy.c: Calculate the clear-area size consistently.
Mark Wooding [Fri, 8 Apr 2022 17:24:22 +0000 (18:24 +0100)]
dvd-sector-copy.c: Calculate the clear-area size consistently.

This should be determined as a (possibly fractional) multiple of the
distance from the start of the bad region to the current position.
Alas, the code for the bounding stage incorrectly used the distance from
the previous position to the new one.  The inconsistency between the
bounding and refinement stages of the recovery algorithm could lead to
failed invariants and a nonsense result.

2 years agodvd-sector-copy.c (find_good_sector): Update the progress display later.
Mark Wooding [Fri, 8 Apr 2022 16:29:23 +0000 (17:29 +0100)]
dvd-sector-copy.c (find_good_sector): Update the progress display later.

In particular, after clearing the display for debugging rather than
before.

2 years ago@@@ dvd-sector-copy.c: Rearrange into a more logical order.
Mark Wooding [Fri, 8 Apr 2022 16:10:21 +0000 (17:10 +0100)]
@@@ dvd-sector-copy.c: Rearrange into a more logical order.

2 years agodvd-sector-copy.c (find_good_sector): Use plain `read_sectors' for retries.
Mark Wooding [Fri, 8 Apr 2022 16:13:54 +0000 (17:13 +0100)]
dvd-sector-copy.c (find_good_sector): Use plain `read_sectors' for retries.

This saves engaging the recovery buffering machinery until it's actually
going to be useful.  If the retry read actually reads anything at all
then we've succeeded and don't need the recovery machinery; if it
doesn't, then there's nothing left in the buffer anyway.

2 years agodvd-sector-copy.c (run_length_wanted): Round the initial requirement up.
Mark Wooding [Fri, 8 Apr 2022 16:11:14 +0000 (17:11 +0100)]
dvd-sector-copy.c (run_length_wanted): Round the initial requirement up.

2 years agodvd-sector-copy.c: Fold `report_bad_blocks_progress' into `recovered'.
Mark Wooding [Fri, 8 Apr 2022 16:07:55 +0000 (17:07 +0100)]
dvd-sector-copy.c: Fold `report_bad_blocks_progress' into `recovered'.

It's not very complicated; it's only used once; and it saves a call to
`store_filename'.

2 years agodvd-sector-copy.c (recovery_read_sectors): Cross-check POS and OFF.
Mark Wooding [Fri, 8 Apr 2022 15:50:15 +0000 (16:50 +0100)]
dvd-sector-copy.c (recovery_read_sectors): Cross-check POS and OFF.

2 years agodvd-sector-copy.c (read_sectors): Force `errno' to zero even if WANT = 0.
Mark Wooding [Fri, 8 Apr 2022 15:45:03 +0000 (16:45 +0100)]
dvd-sector-copy.c (read_sectors): Force `errno' to zero even if WANT = 0.

Otherwise we'd get confused at the end.  I don't think anything actually
tries to call `read_sectors' with WANT = 0, but it's better not to leave
a booby trap here.

2 years agodvd-sector-copy.c: Fix broken indentation.
Mark Wooding [Fri, 8 Apr 2022 14:47:20 +0000 (15:47 +0100)]
dvd-sector-copy.c: Fix broken indentation.

2 years agolib.[ch], *.c: Have `open_dvd' return errors rather than bailing.
Mark Wooding [Fri, 8 Apr 2022 14:40:49 +0000 (15:40 +0100)]
lib.[ch], *.c: Have `open_dvd' return errors rather than bailing.

In particular, this means that `dvd-id' can report on all of the other
discs.

2 years agochkdvdimg.c: Factor out `set_status' subroutine.
Mark Wooding [Fri, 8 Apr 2022 14:38:45 +0000 (15:38 +0100)]
chkdvdimg.c: Factor out `set_status' subroutine.

2 years agolib.[ch], dvd-sector-copy.c: Publish `read_line'.
Mark Wooding [Fri, 8 Apr 2022 14:35:28 +0000 (15:35 +0100)]
lib.[ch], dvd-sector-copy.c: Publish `read_line'.

2 years agolib.[ch], dvd-sector-copy.c: Publish the `buf' machinery as inline functions.
Mark Wooding [Fri, 8 Apr 2022 14:31:24 +0000 (15:31 +0100)]
lib.[ch], dvd-sector-copy.c: Publish the `buf' machinery as inline functions.

Translate the macros into inline functions, and export them from
`lib.h', with some minor tweaking.

  * I've added `buf_putz', and fixed `buf_putc' to advance the output
    pointer as one would expect.

  * I've pulled the actual buffer extension into an out-of-line
    function.

2 years agolib.[ch]: Move the memory allocation out-of-line.
Mark Wooding [Fri, 8 Apr 2022 14:29:13 +0000 (15:29 +0100)]
lib.[ch]: Move the memory allocation out-of-line.

2 years agolib.h: Add missing documentation of FILE argument to `device_size'.
Mark Wooding [Fri, 8 Apr 2022 14:27:17 +0000 (15:27 +0100)]
lib.h: Add missing documentation of FILE argument to `device_size'.

2 years agodvd-sector-copy.c: Sit for the bad-blocks delay if we get an actual hit.
Mark Wooding [Sat, 26 Mar 2022 14:13:12 +0000 (14:13 +0000)]
dvd-sector-copy.c: Sit for the bad-blocks delay if we get an actual hit.

2 years agolib.[ch], dvd-sector-copy.c: Publish a couple of generally handy utilities.
Mark Wooding [Fri, 25 Mar 2022 19:56:41 +0000 (19:56 +0000)]
lib.[ch], dvd-sector-copy.c: Publish a couple of generally handy utilities.

2 years agolib.h: Disable magic attributes if the compiler doesn't understand them.
Mark Wooding [Fri, 25 Mar 2022 19:01:15 +0000 (19:01 +0000)]
lib.h: Disable magic attributes if the compiler doesn't understand them.

2 years agolib.[ch]: Add documentation and commentary.
Mark Wooding [Fri, 25 Mar 2022 19:00:24 +0000 (19:00 +0000)]
lib.[ch]: Add documentation and commentary.

2 years agolib.h: Make `MAXIDSZ' clearer about where the value comes from.
Mark Wooding [Fri, 25 Mar 2022 18:58:39 +0000 (18:58 +0000)]
lib.h: Make `MAXIDSZ' clearer about where the value comes from.

The number 99 is just a bit too round to believe that it's actually
carefully calculated rather than chosen arbitrarily.

2 years agolib.[ch]: Rearrange the toplevel definitions into a more sensible order.
Mark Wooding [Fri, 25 Mar 2022 18:56:44 +0000 (18:56 +0000)]
lib.[ch]: Rearrange the toplevel definitions into a more sensible order.

No code changes.

2 years agomultiprogress.h: Use a macro to mark `printf'-like functions.
Mark Wooding [Fri, 25 Mar 2022 18:52:31 +0000 (18:52 +0000)]
multiprogress.h: Use a macro to mark `printf'-like functions.

Rather than using `__attribute__' directly.

2 years agomultiprogress.[ch]: Add commentary.
Mark Wooding [Fri, 25 Mar 2022 01:41:10 +0000 (01:41 +0000)]
multiprogress.[ch]: Add commentary.

Also some light layout changes.

2 years agomultiprogress.c (progress_shownotice): Remove pointless guard.
Mark Wooding [Fri, 25 Mar 2022 01:34:17 +0000 (01:34 +0000)]
multiprogress.c (progress_shownotice): Remove pointless guard.

The `progress_put_sequence' function already does the right thing here.

2 years agomultiprogress.c: Set the terminal stream to be fully buffered.
Mark Wooding [Fri, 25 Mar 2022 01:32:37 +0000 (01:32 +0000)]
multiprogress.c: Set the terminal stream to be fully buffered.

The `free_render_state' function correctly forces output when we're done.

2 years agomultiprogress.c (clear_progress): Don't check for output errors.
Mark Wooding [Fri, 25 Mar 2022 01:31:51 +0000 (01:31 +0000)]
multiprogress.c (clear_progress): Don't check for output errors.

Nobody's watching to see if we found any.  Indeed, we might as well not
return anything at all.  So, err, don't.

2 years agomultiprogress.c (clear_progress): Don't check `tty->fp': the caller did it.
Mark Wooding [Fri, 25 Mar 2022 01:29:54 +0000 (01:29 +0000)]
multiprogress.c (clear_progress): Don't check `tty->fp': the caller did it.

2 years agomultiprogress.[ch]: Publish the terminal-sequence output functions.
Mark Wooding [Fri, 25 Mar 2022 01:23:51 +0000 (01:23 +0000)]
multiprogress.[ch]: Publish the terminal-sequence output functions.

Otherwise externally-defined renderers don't have a good way to do this.

2 years agomultiprogress.c (clear_progress): Write the `n - 1' loops in a better way.
Mark Wooding [Fri, 25 Mar 2022 01:19:01 +0000 (01:19 +0000)]
multiprogress.c (clear_progress): Write the `n - 1' loops in a better way.

2 years agomultiprogress.c: Don't copy the contents of the temporary buffer.
Mark Wooding [Fri, 25 Mar 2022 01:16:39 +0000 (01:16 +0000)]
multiprogress.c: Don't copy the contents of the temporary buffer.

Nothing relies on the temporary buffer's contents being preserved.

2 years agomultiprogress.c: Fix `split_string' to overestimate.
Mark Wooding [Fri, 25 Mar 2022 01:12:56 +0000 (01:12 +0000)]
multiprogress.c: Fix `split_string' to overestimate.

Doing the right thing in `advance_measure' is much harder if
`split_string' sometimes falls short of the requested bound because of
wide characters.  On the other hand, overestimating is a little tricky
because we must remember to include all of the following zero-
width (e.g., combining) characters or the prefix will just be wrong.
But it's better to do this than come up with some kludge to make
`advance_measure' sometimes advance the state even when we've not
actually reached the right position.

2 years agomultiprogress.c: Remove pointless return value from `setup_render_state'.
Mark Wooding [Fri, 25 Mar 2022 01:02:33 +0000 (01:02 +0000)]
multiprogress.c: Remove pointless return value from `setup_render_state'.

It's being checked, and, indeed, passed on.  But it didn't actually do
very much other than prevent the terminal-width fallback logic from
being useful.  So delete it.

2 years agomultiprogress.[ch]: Rearrange the toplevel definitions more sensibly.
Mark Wooding [Fri, 25 Mar 2022 00:57:21 +0000 (00:57 +0000)]
multiprogress.[ch]: Rearrange the toplevel definitions more sensibly.

2 years agomultiprogress.c: Pair calls to `free' with zeroing the points.
Mark Wooding [Fri, 25 Mar 2022 00:51:40 +0000 (00:51 +0000)]
multiprogress.c: Pair calls to `free' with zeroing the points.

2 years agomultiprogress.[ch]: Save and restore `PC' in the render state.
Mark Wooding [Fri, 25 Mar 2022 00:42:44 +0000 (00:42 +0000)]
multiprogress.[ch]: Save and restore `PC' in the render state.

2 years agomultiprogress.h: Add the right number of zeros to `PROGRESS_TTYINFO_INIT'.
Mark Wooding [Fri, 25 Mar 2022 00:49:59 +0000 (00:49 +0000)]
multiprogress.h: Add the right number of zeros to `PROGRESS_TTYINFO_INIT'.

2 years agomultiprogress.c: Get the `termcap' string after allocating the buffers.
Mark Wooding [Fri, 25 Mar 2022 00:39:47 +0000 (00:39 +0000)]
multiprogress.c: Get the `termcap' string after allocating the buffers.

It works better that way, except with GNU `termcap'.

2 years agomultiprogress.h: Fix an erroneously indented line.
Mark Wooding [Fri, 25 Mar 2022 00:48:22 +0000 (00:48 +0000)]
multiprogress.h: Fix an erroneously indented line.

2 years agoMerge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/dvdrip master
Mark Wooding [Tue, 22 Mar 2022 21:38:19 +0000 (21:38 +0000)]
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/dvdrip

* 'master' of git.distorted.org.uk:~mdw/publish/public-git/dvdrip:
  dvd-info.c: Trigger the easy lookup if explicit chapter bounds aren't given.
  dvd-info.c: Don't forget to dump the last titleset.
  dvd-info.c: Add missing `\' in output banner.

2 years agochkdvdimg.c: Open the image file with `open_dvd'.
Mark Wooding [Tue, 22 Mar 2022 21:37:27 +0000 (21:37 +0000)]
chkdvdimg.c: Open the image file with `open_dvd'.

This means that it will wait until we actually insert a disc.  Yay!

2 years agolib.c, and knock-on: Add MODE argument to `open_dvd'.
Mark Wooding [Tue, 22 Mar 2022 21:34:37 +0000 (21:34 +0000)]
lib.c, and knock-on: Add MODE argument to `open_dvd'.

Everyone wants read-only for now.

2 years agodvd-info.c: Trigger the easy lookup if explicit chapter bounds aren't given.
Mark Wooding [Tue, 22 Mar 2022 21:30:10 +0000 (21:30 +0000)]
dvd-info.c: Trigger the easy lookup if explicit chapter bounds aren't given.

2 years agodvd-info.c: Don't forget to dump the last titleset.
Mark Wooding [Tue, 22 Mar 2022 21:29:51 +0000 (21:29 +0000)]
dvd-info.c: Don't forget to dump the last titleset.

2 years agodvd-info.c: Add missing `\' in output banner.
Mark Wooding [Tue, 22 Mar 2022 21:29:11 +0000 (21:29 +0000)]
dvd-info.c: Add missing `\' in output banner.

2 years agoAdd a new program `dvd-info' to report on interesting things.
Mark Wooding [Sat, 19 Mar 2022 14:10:30 +0000 (14:10 +0000)]
Add a new program `dvd-info' to report on interesting things.

I'm getting deeper in here, I know.

2 years agocheckimg: Don't complain about every mismatch.
Mark Wooding [Sat, 19 Mar 2022 14:09:49 +0000 (14:09 +0000)]
checkimg: Don't complain about every mismatch.

We can tell from the summary.

2 years agodvd-sector-copy.c: Use `bad_hi' consistently for the upper bound when done.
Mark Wooding [Sat, 19 Mar 2022 14:08:43 +0000 (14:08 +0000)]
dvd-sector-copy.c: Use `bad_hi' consistently for the upper bound when done.

It's just conceivable that `good' is less than `bad_hi' at this point,
which screws everything up.  It's essential to pick a consistent upper
bound here.

2 years agodvd-sector-copy.c, lib.[ch]: Improve and publish the number parsing functions.
Mark Wooding [Sat, 19 Mar 2022 14:08:07 +0000 (14:08 +0000)]
dvd-sector-copy.c, lib.[ch]: Improve and publish the number parsing functions.

2 years agoMakefile: Factor out the `CFLAGS'.
Mark Wooding [Sat, 19 Mar 2022 14:07:15 +0000 (14:07 +0000)]
Makefile: Factor out the `CFLAGS'.

Makes overriding from the command line less awful.

2 years agodvd-sector-copy.c: Show file ends in the dump.
Mark Wooding [Fri, 11 Mar 2022 11:40:40 +0000 (11:40 +0000)]
dvd-sector-copy.c: Show file ends in the dump.

2 years agodvd-sector-copy.c: Wrap long line properly.
Mark Wooding [Fri, 11 Mar 2022 11:40:16 +0000 (11:40 +0000)]
dvd-sector-copy.c: Wrap long line properly.

2 years agodvdrip-upload: Fix self-call the case where there's no daemon running.
Mark Wooding [Wed, 9 Mar 2022 11:34:04 +0000 (11:34 +0000)]
dvdrip-upload: Fix self-call the case where there's no daemon running.

2 years agodvd-sector-copy.c: Truncate the event list before processing a lost `stop'.
Mark Wooding [Mon, 7 Mar 2022 23:47:20 +0000 (23:47 +0000)]
dvd-sector-copy.c: Truncate the event list before processing a lost `stop'.

2 years agodvd-sector-copy.c: Report final statistics correctly.
Mark Wooding [Mon, 7 Mar 2022 23:46:52 +0000 (23:46 +0000)]
dvd-sector-copy.c: Report final statistics correctly.

2 years agodvd-sector-copy.c: Dump the event queue before we start processing it.
Mark Wooding [Mon, 7 Mar 2022 23:46:29 +0000 (23:46 +0000)]
dvd-sector-copy.c: Dump the event queue before we start processing it.

2 years agodvd-sector-copy.c: Eliminate unused variable.
Mark Wooding [Mon, 7 Mar 2022 23:45:57 +0000 (23:45 +0000)]
dvd-sector-copy.c: Eliminate unused variable.

2 years agodvd-sector-copy.c: Fix botched debugging code.
Mark Wooding [Mon, 7 Mar 2022 23:45:29 +0000 (23:45 +0000)]
dvd-sector-copy.c: Fix botched debugging code.

2 years agochkdvdimg.c: Name the file when reporting too many trailing zeros.
Mark Wooding [Mon, 7 Mar 2022 12:48:05 +0000 (12:48 +0000)]
chkdvdimg.c: Name the file when reporting too many trailing zeros.

2 years agodvd-sector-copy.c: Add missing handler for the `-i' option.
Mark Wooding [Mon, 7 Mar 2022 00:36:12 +0000 (00:36 +0000)]
dvd-sector-copy.c: Add missing handler for the `-i' option.

2 years agochkdvdimg.c: Retrieve device size using the new function.
Mark Wooding [Sun, 6 Mar 2022 23:57:20 +0000 (23:57 +0000)]
chkdvdimg.c: Retrieve device size using the new function.

... which works on block devices as well as ordinary files.

2 years agodvd-sector-copy.c: Export device-size machinery to the library.
Mark Wooding [Sun, 6 Mar 2022 23:54:02 +0000 (23:54 +0000)]
dvd-sector-copy.c: Export device-size machinery to the library.

2 years agodvdrip: Check for the device size apparently changing during the copy.
Mark Wooding [Sun, 6 Mar 2022 23:53:21 +0000 (23:53 +0000)]
dvdrip: Check for the device size apparently changing during the copy.

This indicates something going horribly wrong.

2 years agodvdrip: Fail if we can't read the `.IFO' hash for the disc id.
Mark Wooding [Sun, 6 Mar 2022 20:42:02 +0000 (20:42 +0000)]
dvdrip: Fail if we can't read the `.IFO' hash for the disc id.

This may help with the kernel reporting stale medium sizes.

2 years agodvd-sector-copy.c: Add option to verify source id.
Mark Wooding [Sun, 6 Mar 2022 20:34:50 +0000 (20:34 +0000)]
dvd-sector-copy.c: Add option to verify source id.

2 years agoscripts: Call utilities via environment variables.
Mark Wooding [Sun, 6 Mar 2022 20:34:17 +0000 (20:34 +0000)]
scripts: Call utilities via environment variables.

2 years agodvd-id.c, lib.[ch]: Improve DVD ID computation.
Mark Wooding [Sun, 6 Mar 2022 17:32:51 +0000 (17:32 +0000)]
dvd-id.c, lib.[ch]: Improve DVD ID computation.

Move the code to the library.  Accept flags (to the library function and
the utility) to fail if portions of the ID can't be determined.

Also, improve `dvd-id' to print IDs for multiple disc images.

2 years agochkdvdimg: Add a new program for checking DVD images.
Mark Wooding [Sun, 6 Mar 2022 16:23:18 +0000 (16:23 +0000)]
chkdvdimg: Add a new program for checking DVD images.

Primarily I'm interested in checking that the length is right, because
one of my DVD drives sometimes reports the wrong medium size
(specifically, I think, the size for the previous medium).  Also,
sometimes there are zero sectors stuck on the end, which complicates
finding the backup UDF anchor descriptor, so provide an option to trim
these.

2 years agolib.h: Publish a `MEMCMP' macro, like `STRCMP'.
Mark Wooding [Sun, 6 Mar 2022 16:22:32 +0000 (16:22 +0000)]
lib.h: Publish a `MEMCMP' macro, like `STRCMP'.

2 years agolib.c, lib.h: Introduce `vmoan_syserr' and `moan_syserr'.
Mark Wooding [Sun, 6 Mar 2022 16:21:36 +0000 (16:21 +0000)]
lib.c, lib.h: Introduce `vmoan_syserr' and `moan_syserr'.

This cleans up this little family of functions.  There's a behaviour
change: `vmoan' now prints a newline which it didn't before, and callers
have been adjusted to compensate.

2 years agolib.c: Remove redundant format attributes.
Mark Wooding [Sun, 6 Mar 2022 16:18:00 +0000 (16:18 +0000)]
lib.c: Remove redundant format attributes.

Should use `PRINTF_LIKE' nowadays anyway.

2 years agodvdrip-retry-botched-vobs: Retry using the newly determined block list.
Mark Wooding [Sun, 6 Mar 2022 03:44:54 +0000 (03:44 +0000)]
dvdrip-retry-botched-vobs: Retry using the newly determined block list.

Fortunately, I didn't actually engage this case when I did this to my
collection.

2 years agodvdrip-retry-botched-vobs: Process discs in a useful order.
Mark Wooding [Sun, 6 Mar 2022 01:31:47 +0000 (01:31 +0000)]
dvdrip-retry-botched-vobs: Process discs in a useful order.

2 years agodvdrip-retry-botched-vobs: Eject discs when we're done with them.
Mark Wooding [Sun, 6 Mar 2022 01:27:14 +0000 (01:27 +0000)]
dvdrip-retry-botched-vobs: Eject discs when we're done with them.

2 years agodvdrip-retry-botched-vobs: Delete the retry file correctly.
Mark Wooding [Sun, 6 Mar 2022 01:27:03 +0000 (01:27 +0000)]
dvdrip-retry-botched-vobs: Delete the retry file correctly.

2 years agodvdrip-retry-botched-vobs: Be more vocal about wrong discs.
Mark Wooding [Sun, 6 Mar 2022 01:26:43 +0000 (01:26 +0000)]
dvdrip-retry-botched-vobs: Be more vocal about wrong discs.

2 years agoNew programs for dealing with VOBs ripped without being decrypted.
Mark Wooding [Sun, 6 Mar 2022 01:11:00 +0000 (01:11 +0000)]
New programs for dealing with VOBs ripped without being decrypted.

When my drives were configured with the wrong region, `libdvdcss' would
have to crack the keys the hard way, and it sometimes failed.  I mostly
shrugged my shoulders, but now I've fixed this problem, I thought I'd
track down the miscopied VOBs and make some tools for fixing the
problem.