Make "is not before last_sector" a warning rather than error

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
gwalton
Posts: 2
Joined: Mon Sep 01, 2014 2:36 pm

Make "is not before last_sector" a warning rather than error

Post by gwalton »

I've encountered some DVDs which (likely due to bad mastering) trigger the HandBrake error: "is not before last_sector" and as a result the correct title is ignored. This makes it impossible to process this title, even with the command-line tool and specifying the appropriate title number. These DVDs do play back using the Apple DVD player and VLC so other tools are not as strict as HandBrake at validating the DVD format.

The problem can be fixed simply by disabling the error, as done in the attached patch. I was then able to process the titles I needed without any problem, and have not encountered issues with other DVDs either.
User avatar
s55
HandBrake Team
Posts: 10357
Joined: Sun Dec 24, 2006 1:05 pm

Re: Make "is not before last_sector" a warning rather than e

Post by s55 »

You didn't attach the patch?
gwalton
Posts: 2
Joined: Mon Sep 01, 2014 2:36 pm

Re: Make "is not before last_sector" a warning rather than e

Post by gwalton »

Apologies, here's the (trivial) patch:

Code: Select all

Index: libhb/dvd.c
===================================================================
--- libhb/dvd.c	(revision 6262)
+++ libhb/dvd.c	(working copy)
@@ -242,7 +242,7 @@
                     "is not before last_sector (0x%x) - skipping title", i,
                     vts->vts_c_adt->cell_adr_table[i].start_sector,
                     vts->vts_c_adt->cell_adr_table[i].last_sector );
-            goto fail;
+            //goto fail;
         }
     }
User avatar
s55
HandBrake Team
Posts: 10357
Joined: Sun Dec 24, 2006 1:05 pm

Re: Make "is not before last_sector" a warning rather than e

Post by s55 »

hah, go to love the "goto fail" bugs this year :)
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: Make "is not before last_sector" a warning rather than e

Post by JohnAStebbins »

s55 wrote:hah, go to love the "goto fail" bugs this year :)
Although this isn't a "bug". That code was added to address crashes that would occur when those particular conditions occurred. So I will need to reevaluate the original issue before this kind of change can be made.
See viewtopic.php?f=4&t=9758&sid=b6deb84bf0 ... 722#p53722
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: Make "is not before last_sector" a warning rather than e

Post by JohnAStebbins »

gwalton, I don't want to try to fix this till after we get the pending release out the door. It's going to need more test time than we can give it right now. In rereading the original forum thread about the problem, I see that the actual root cause of the crash was never determined and the patch was just a workaround that solved the immediate issue. There is even a note I made about another user having the same problem as you. So I think it would be good to toss the original patch and uncover the real issue (if it still exists). But not right now.

This same block of code was also added to dvdnav.c at the same time it was added to dvd.c. I removed it from dvdnav.c a while ago because there were more discs showing up that it causes issues with. https://trac.handbrake.fr/changeset/5787

Which brings up a point, why do you have dvdnav disabled. You would not have this problem if you left dvdnav enabled in preferences.
Post Reply