First thing I noticed, libdvdread has a few things to say on the VTS data:
HandBrakeCLI --input "/Volumes/TvRAID/The Muppet Show/Muppet Show, The - Season 2 - Disc 2.dvdmedia" -t 0 -v 3
[18:01:51] scan: scanning title 9
[18:01:51] scan: opening IFO for VTS 8
*** libdvdread: CHECK_VALUE failed in ifo_read.c:1571 ***
*** for c_adt->cell_adr_table.start_sector < c_adt->cell_adr_table.last_sector ***
*** Zero check failed in ifo_read.c:1566
for c_adt->cell_adr_table.zero_1 = 0xc0
*** libdvdread: CHECK_VALUE failed in ifo_read.c:1571 ***
*** for c_adt->cell_adr_table.start_sector < c_adt->cell_adr_table.last_sector ***
*** Zero check failed in ifo_read.c:1566
for c_adt->cell_adr_table.zero_1 = 0x20
*** libdvdread: CHECK_VALUE failed in ifo_read.c:1568 ***
*** for c_adt->cell_adr_table.vob_id <= c_adt->nr_of_vobs ***
*** libdvdread: CHECK_VALUE failed in ifo_read.c:1571 ***
*** for c_adt->cell_adr_table.start_sector < c_adt->cell_adr_table.last_sector ***
[18:01:51] pgc_id: 2, pgn: 1: pgc: 0xd6000000
zsh: segmentation fault ./build/HandBrakeCLI --input -o /tmp/foo -t 0 -v 3
(Fiddling ulimit -c to get a core file shows the crash is in hb_dvd_title_scan in libhb/dvd.c, but since I'm doing this on a non-debug build, no line numbers. But I never have much luck with debuggers, so I'm not going to start worrying about that now.)
My first thought was to trap that odd-looking pgc value. But then a different scan showed up with 0x7fffffff, so that's not right.
I decided to implement the same check that ifo_read.c is doing, especially the start and last ordering problem. So, one short patch later:
Code: Select all
--- libhb/dvd.c (revision 2239)
+++ libhb/dvd.c (working copy)
@@ -165,6 +165,20 @@
goto fail;
}
+ for(i = 0; i < vts->vts_c_adt->nr_of_vobs; ++i) {
+ if(vts->vts_c_adt->cell_adr_table[i].start_sector >=
+ vts->vts_c_adt->cell_adr_table[i].last_sector) {
+ hb_error( "scan: cell_adr_table[%d].start_sector (0x%x) is not before last_sector (0x%x), skipping",i,
+ vts->vts_c_adt->cell_adr_table[i].start_sector,
+ vts->vts_c_adt->cell_adr_table[i].last_sector);
+ goto fail;
+ }
+ if(vts->vts_c_adt->cell_adr_table[i].zero_1) {
+ hb_error( "scan: cell_adr_table[%d].zero_1 (0x%x) is not zero, skipping", i, vts->vts_c_adt->cell_adr_table[i].zero_1);
+ goto fail;
+ }
+ }
+
if( global_verbosity_level == 3 )
{
ifoPrint( d->reader, title->vts );
ERROR: scan: cell_adr_table[0].start_sector (0x7fffffff) is not before last_sector (0x7fffffff), skipping
[18:10:39] scan: scanning title 10
...and the CLI goes on to complete the scan. The GUI now lets me choose the titles I want.
I know 0x7fffffff is magic with seamless branching, but I don't know if it applies to the sector numbers. I'm going to run with this patch and see if anything is missing its feature as a result.