]> git.decadent.org.uk Git - videolink.git/commitdiff
Moved dvdauthor quirk out of dvd.hpp.
authorBen Hutchings <ben@decadent.org.uk>
Wed, 1 Nov 2006 01:32:40 +0000 (01:32 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 23:58:12 +0000 (23:58 +0000)
dvd.hpp
generate_dvd.cpp

diff --git a/dvd.hpp b/dvd.hpp
index db0f9835a7472a6a1fd896003958e4a64f0d2daa..f1b1bb14ef6de9f7f376b869cffb4b47bc3b0aa8 100644 (file)
--- a/dvd.hpp
+++ b/dvd.hpp
@@ -18,9 +18,7 @@ namespace dvd
     const unsigned reg_s8_button_mult = 0x400;
 
     // Maximum number of PGCs in a domain that can be linked to.
-    // dvdauthor uses some menu numbers for special purposes,
-    // resulting in a practical limit of 119 per domain.
-    const unsigned domain_pgcs_max = 119;
+    const unsigned domain_pgcs_max = 127;
 
     // Maximum number of titles on a disc.  (Also the maximum number of
     // titlesets per disc.)
index 7f496c23e2b2a71d97411f80f6f27308b475ed1b..eb8fc0498fe0895cde21234810bfa5cc671773b6 100644 (file)
@@ -98,6 +98,13 @@ namespace
        oss << "exceeded DVD limit: " << limit_type << " > " << limit;
        throw std::length_error(oss.str());
     }
+
+    // dvdauthor uses some menu numbers to represent entry points -
+    // distinct from the actual numbers of the menus assigned as those
+    // entry points - resulting in a practical limit of 119 per
+    // domain.  This seems to be an oddity of the parser that could be
+    // fixed, but for now we'll have to work with it.
+    const unsigned dvdauthor_anonymous_menus_max = dvd::domain_pgcs_max - 8;
 }
 
 dvd_generator::dvd_generator(const video::frame_params & frame_params,
@@ -111,8 +118,8 @@ dvd_generator::pgc_ref dvd_generator::add_menu()
 {
     pgc_ref next_menu(menu_pgc, menus_.size());
 
-    if (next_menu.index == dvd::domain_pgcs_max)
-       throw_length_error("number of menus", dvd::domain_pgcs_max);
+    if (next_menu.index == dvdauthor_anonymous_menus_max)
+       throw_length_error("number of menus", dvdauthor_anonymous_menus_max);
 
     menus_.resize(next_menu.index + 1);
     return next_menu;