diff options
author | jstebbins <[email protected]> | 2009-11-16 19:32:49 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-11-16 19:32:49 +0000 |
commit | fc45fb323ef56083c6a8753b6332b84b5faaf0fe (patch) | |
tree | 02bbbccb8916a3f40376b5461fd277e4f9a89b94 | |
parent | 234471f57b92b167f15a6cd99e81465337302d56 (diff) |
a better patch for handling MTR missing menu scenario
The previous method was not very robust and we found corner cases that broke.
This new method explicitly checks for the existance of a menu whenever
the vm attempts to transition to a menu. If there is no menu, it enters
the Exit state.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2940 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | contrib/libdvdnav/A06-null-pgcit.patch | 17 | ||||
-rw-r--r-- | contrib/libdvdnav/A07-missing-menu.patch | 110 |
2 files changed, 110 insertions, 17 deletions
diff --git a/contrib/libdvdnav/A06-null-pgcit.patch b/contrib/libdvdnav/A06-null-pgcit.patch deleted file mode 100644 index 8456b6400..000000000 --- a/contrib/libdvdnav/A06-null-pgcit.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -Naur libdvdnav.orig/src/vm/vm.c libdvdnav/src/vm/vm.c ---- libdvdnav.orig/src/vm/vm.c 2009-03-13 18:28:22.000000000 -0700 -+++ libdvdnav/src/vm/vm.c 2009-10-11 17:49:17.813221643 -0700 -@@ -1866,6 +1866,13 @@ - default: - abort(); - } -+ // get_MENU_PGCIT fails if h->pgci_ut == NULL. -+ // this happens with badly mastered discs. Mac The Ripper happens -+ // to create such discs when in "Main Feature Extraction" mode. -+ if(pgcit == NULL && vm->vtsi != NULL) { -+ (vm->state).domain = VTS_DOMAIN; -+ pgcit = vm->vtsi->vts_pgcit; -+ } - - return pgcit; - } diff --git a/contrib/libdvdnav/A07-missing-menu.patch b/contrib/libdvdnav/A07-missing-menu.patch new file mode 100644 index 000000000..078f4748e --- /dev/null +++ b/contrib/libdvdnav/A07-missing-menu.patch @@ -0,0 +1,110 @@ +diff -Naur libdvdnav.orig/src/vm/vm.c libdvdnav/src/vm/vm.c +--- libdvdnav.orig/src/vm/vm.c 2009-10-29 09:10:44.836643320 -0700 ++++ libdvdnav/src/vm/vm.c 2009-11-16 11:10:07.527247268 -0800 +@@ -585,6 +585,9 @@ + switch(menuid) { + case DVD_MENU_Title: + case DVD_MENU_Escape: ++ if(vm->vmgi == NULL || vm->vmgi->pgci_ut == NULL) { ++ goto fail; ++ } + (vm->state).domain = VMGM_DOMAIN; + break; + case DVD_MENU_Root: +@@ -592,6 +595,9 @@ + case DVD_MENU_Audio: + case DVD_MENU_Angle: + case DVD_MENU_Part: ++ if(vm->vtsi == NULL || vm->vtsi->pgci_ut == NULL) { ++ goto fail; ++ } + (vm->state).domain = VTSM_DOMAIN; + break; + } +@@ -606,6 +612,7 @@ + break; + } + ++fail: + return 0; + } + +@@ -1488,6 +1495,10 @@ + /* Allowed from anywhere except the VTS Title domain */ + /* Stop SPRM9 Timer and any GPRM counters */ + assert((vm->state).domain != VTS_DOMAIN); /* ?? */ ++ if(vm->vmgi == NULL || vm->vmgi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } + (vm->state).domain = VMGM_DOMAIN; + if(!set_MENU(vm, link_values.data1)) + assert(0); +@@ -1504,14 +1515,22 @@ + if (link_values.data1 != (vm->state).vtsN) { + /* the normal case */ + assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ +- (vm->state).domain = VTSM_DOMAIN; + if (!ifoOpenNewVTSI(vm, vm->dvd, link_values.data1)) /* Also sets (vm->state).vtsN */ + assert(0); ++ if(vm->vtsi == NULL || vm->vtsi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } ++ (vm->state).domain = VTSM_DOMAIN; + } else { + /* This happens on some discs like "Captain Scarlet & the Mysterons" or + * the German RC2 of "Anatomie" in VTSM. */ + assert((vm->state).domain == VTSM_DOMAIN || + (vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ ++ if(vm->vtsi == NULL || vm->vtsi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } + (vm->state).domain = VTSM_DOMAIN; + } + } else { +@@ -1533,6 +1552,10 @@ + /* set_PGCN:data1 */ + /* Stop SPRM9 Timer and any GPRM counters */ + assert((vm->state).domain != VTS_DOMAIN); /* ?? */ ++ if(vm->vmgi == NULL || vm->vmgi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } + (vm->state).domain = VMGM_DOMAIN; + if(!set_PGCN(vm, link_values.data1)) + assert(0); +@@ -1552,6 +1575,10 @@ + /* set_RSMinfo:data2 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ ++ if(vm->vmgi == NULL || vm->vmgi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } + set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0); + (vm->state).domain = VMGM_DOMAIN; + if(!set_MENU(vm, link_values.data1)) +@@ -1563,6 +1590,10 @@ + /* set_RSMinfo:data2 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ ++ if(vm->vtsi == NULL || vm->vtsi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } + set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0); + (vm->state).domain = VTSM_DOMAIN; + if(!set_MENU(vm, link_values.data1)) +@@ -1574,6 +1605,10 @@ + /* set_RSMinfo:data2 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ ++ if(vm->vmgi == NULL || vm->vmgi->pgci_ut == NULL) { ++ link_values.command = Exit; ++ break; ++ } + set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0); + (vm->state).domain = VMGM_DOMAIN; + if(!set_PGCN(vm, link_values.data1)) |