Scripting bug

Martin Hilpert <[email protected]> Mon, 06 Oct 2014 19:14:36 +0200
Newsgroups gmane.comp.multimedia.dvdauthor.user
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============0849327120815839983==
Content-Type: multipart/alternative;
	boundary="------------080906080000020402020707"

This is a multi-part message in MIME format.
--------------080906080000020402020707
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit



There is a serious scripting  bug in DVDAuthor, version 0.7.1.
A conditional  jump to a menu like the following will not  be assembled 
correctly:

      <!--************** MENU 1 **************-->

     ...

      <pre >g4=1; if(g3!=0){ g4=2; jump menu 2;}  button=g4*1024; </pre>


When g3 is not zero, there is no jump to menu 2,  instead button 2 of 
menu 1 will be highlighted.
Opening the ifo-file with the tool *IfoEdit*, you see why:

     1.Pre Command    Set GPreg<4> mov (set-val)<1>

     2.Pre Command    If GPreg<3> != (cmp-val)<0> then Set GPreg<4> mov (set-val)<2>

     3.Pre Command    Set GPreg<13> mov GPreg<4>

     4.Pre Command    Set GPreg<13> mul (set-val)<1024>

     5.Pre Command    (SetHL_BTNN) Set Button Nr: GPreg<13>

     1.Post Command    Exit

there is no jump ( LinkPGCN ) command !!!!

You can bypass the bug inserting a second (dummy) command:

      <pre >g4=1; if(g3!=0){ g4=2; g4=2; jump menu 2;}  button=g4*1024; </pre>

one gets:

     1.Pre Command    Set GPreg<4> mov (set-val)<1>

     2.Pre Command    If GPreg<3> == (cmp-val)<0><' then Goto line# 5

     3.Pre Command    Set GPreg<4> mov (set-val)<2>

     4.Pre Command    Set GPreg<4> mov (set-val)<2>(LinkPGCN) Link PGC 2

     5.Pre Command    Set GPreg<13> mov GPreg<4>

     6.Pre Command    Set GPreg<13> mul (set-val)<1024>

     7.Pre Command    (SetHL_BTNN) Set Button Nr: GPreg<13>

     1.Post Command    Exit

You also can write:

      <pre >g4=1; if(g3!=0){ g4=2+0; jump menu 2;}  button=g4*1024; </pre>

because g4=2+0; is not a single command.
If the statement has an /else/ part, it is parsed correctly. So it will 
also be ok/,/ to write :

     <pre >g4=1; if(g3!=0){ g4=2; jump menu 2;} else button=g4*1024; </pre>


Similar commands :    if( /condition/ ){ /single command/; jump /Target/;}
where /Target /is : "vmgm menu 1" or "title 1 chapter 2" seem to work 
correctly.

For reference the complete XML-file:
=====================================================================
<?xml version="1.0" encoding="utf-8"?>
<dvdauthor jumppad="0">
   <vmgm>
     <menus>
       <video format="pal" aspect="16:9" widescreen="nopanscan"/>
       <audio lang="DE"/>
       <subpicture lang="DE">
         <stream id="0" mode="widescreen"/>
         <stream id="1" mode="letterbox"/>
       </subpicture>
       <!--************** MENU 1 **************-->
       <pgc entry="title">
         <button name="button01">g3=0;jump titleset 1 menu;</button>
         <button name="button02">g3=1;jump titleset 1 menu;</button>
         <vob file="C:\dvd\tmp\dvd-tmp\menu0-0.mpg" pause="inf"/>
       </pgc>
     </menus>
   </vmgm>
   <titleset>
     <menus>
       <video format="pal" aspect="16:9" widescreen="nopanscan"/>
       <audio lang="DE"/>
       <subpicture lang="DE">
         <stream id="0" mode="widescreen"/>
         <stream id="1" mode="letterbox"/>
       </subpicture>
       <!--************** MENU 1 **************-->
       <pgc entry="root">
         <button name="button01">jump title 1;</button>
         <button name="button02">jump vmgm menu 1;</button>
         <vob file="C:\dvd\tmp\dvd-tmp\menu1-0.mpg" pause="inf"/>
         <pre>g4=1; if(g3!=0){g4=2; jump menu 2;} button=g4*1024;</pre>
       </pgc>
       <!--************** MENU 2 **************-->
       <pgc entry="ptt">
         <button name="button01">jump title 1;</button>
         <button name="button02">jump title 1 chapter 2;</button>
         <vob file="C:\dvd\tmp\dvd-tmp\menu1-1.mpg" pause="inf"/>
         <pre>button=g4*1024;</pre>
       </pgc>
     </menus>
     <titles>
       <video aspect="16:9" widescreen="nopanscan"/>
       <audio lang="DE"/>
       <!--************** TITLE 1 **************-->
       <pgc>
         <vob file="C:\dvd\tmp\dvd-cache\entry001.vob" 
chapters="0:00,0:06"/>
         <post>call menu;</post>
       </pgc>
     </titles>
   </titleset>
</dvdauthor>



--------------080906080000020402020707
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-forward-container"><br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-15">
      There is a serious scripting  bug in DVDAuthor, version 0.7.1. <br>
      A conditional  jump to a menu like the following will not  be
      assembled correctly:<br>
      <pre>     &lt;!--************** MENU 1 **************--&gt;</pre>
      <pre>    ...</pre>
      <pre>     &lt;pre &gt;g4=1; if(g3!=0){ g4=2; jump menu 2;}  button=g4*1024; &lt;/pre&gt;</pre>
      <br>
      When g3 is not zero, there is no jump to menu 2,  instead button 2
      of menu 1 will be highlighted. <br>
      Opening the ifo-file with the tool <b>IfoEdit</b>, you see why:<br>
      <pre>    1.Pre Command    Set GPreg&lt;4&gt; mov (set-val)&lt;1&gt;                                    </pre>
      <pre>    2.Pre Command    If GPreg&lt;3&gt; != (cmp-val)&lt;0&gt; then Set GPreg&lt;4&gt; mov (set-val)&lt;2&gt;    </pre>
      <pre>    3.Pre Command    Set GPreg&lt;13&gt; mov GPreg&lt;4&gt;                                    </pre>
      <pre>    4.Pre Command    Set GPreg&lt;13&gt; mul (set-val)&lt;1024&gt;                            </pre>
      <pre>    5.Pre Command    (SetHL_BTNN) Set Button Nr: GPreg&lt;13&gt;                            </pre>
      <pre>    1.Post Command    Exit                                                            </pre>
      there is no jump ( LinkPGCN ) command !!!!<br>
      <br>
      You can bypass the bug inserting a second (dummy) command:<br>
      <pre>     &lt;pre &gt;g4=1; if(g3!=0){ g4=2; g4=2; jump menu 2;}  button=g4*1024; &lt;/pre&gt;</pre>
      one gets:<br>
      <pre>    1.Pre Command    Set GPreg&lt;4&gt; mov (set-val)&lt;1&gt;                                    </pre>
      <pre>    2.Pre Command    If GPreg&lt;3&gt; == (cmp-val)&lt;0&gt;&lt;' then Goto line# 5                    </pre>
      <pre>    3.Pre Command    Set GPreg&lt;4&gt; mov (set-val)&lt;2&gt;                                    </pre>
      <pre>    4.Pre Command    Set GPreg&lt;4&gt; mov (set-val)&lt;2&gt;(LinkPGCN) Link PGC 2            </pre>
      <pre>    5.Pre Command    Set GPreg&lt;13&gt; mov GPreg&lt;4&gt;                                    </pre>
      <pre>    6.Pre Command    Set GPreg&lt;13&gt; mul (set-val)&lt;1024&gt;                            </pre>
      <pre>    7.Pre Command    (SetHL_BTNN) Set Button Nr: GPreg&lt;13&gt;                            </pre>
      <pre>    1.Post Command    Exit                                                            </pre>
      You also can write:<br>
      <pre>     &lt;pre &gt;g4=1; if(g3!=0){ g4=2+0; jump menu 2;}  button=g4*1024; &lt;/pre&gt;</pre>
      because g4=2+0; is not a single command. <br>
      If the statement has an <i>else</i> part, it is parsed correctly.
      So it will also be ok<i>,</i> to write :<br>
      <pre>    &lt;pre &gt;g4=1; if(g3!=0){ g4=2; jump menu 2;} else button=g4*1024; &lt;/pre&gt;</pre>
      <br>
      Similar commands :    if( <i>condition</i> ){ <i>single command</i>;
      jump <i>Target</i>;}<br>
      where <i>Target </i>is : "vmgm menu 1" or "title 1 chapter 2"
      seem to work correctly.<br>
      <br>
      For reference the complete XML-file:<br>
=====================================================================<br>
      <tt>&lt;?xml version="1.0" encoding="utf-8"?&gt;</tt><tt><br>
      </tt><tt>&lt;dvdauthor jumppad="0"&gt;</tt><tt><br>
      </tt><tt>  &lt;vmgm&gt;</tt><tt><br>
      </tt><tt>    &lt;menus&gt;</tt><tt><br>
      </tt><tt>      &lt;video format="pal" aspect="16:9"
        widescreen="nopanscan"/&gt;</tt><tt><br>
      </tt><tt>      &lt;audio lang="DE"/&gt;</tt><tt><br>
      </tt><tt>      &lt;subpicture lang="DE"&gt;</tt><tt><br>
      </tt><tt>        &lt;stream id="0" mode="widescreen"/&gt;</tt><tt><br>
      </tt><tt>        &lt;stream id="1" mode="letterbox"/&gt;</tt><tt><br>
      </tt><tt>      &lt;/subpicture&gt;</tt><tt><br>
      </tt><tt>      &lt;!--************** MENU 1 **************--&gt;</tt><tt><br>
      </tt><tt>      &lt;pgc entry="title"&gt;</tt><tt><br>
      </tt><tt>        &lt;button name="button01"&gt;g3=0;jump titleset
        1 menu;&lt;/button&gt;</tt><tt><br>
      </tt><tt>        &lt;button name="button02"&gt;g3=1;jump titleset
        1 menu;&lt;/button&gt;</tt><tt><br>
      </tt><tt>        &lt;vob file="C:\dvd\tmp\dvd-tmp\menu0-0.mpg"
        pause="inf"/&gt;</tt><tt><br>
      </tt><tt>      &lt;/pgc&gt;</tt><tt><br>
      </tt><tt>    &lt;/menus&gt;</tt><tt><br>
      </tt><tt>  &lt;/vmgm&gt;</tt><tt><br>
      </tt><tt>  &lt;titleset&gt;</tt><tt><br>
      </tt><tt>    &lt;menus&gt;</tt><tt><br>
      </tt><tt>      &lt;video format="pal" aspect="16:9"
        widescreen="nopanscan"/&gt;</tt><tt><br>
      </tt><tt>      &lt;audio lang="DE"/&gt;</tt><tt><br>
      </tt><tt>      &lt;subpicture lang="DE"&gt;</tt><tt><br>
      </tt><tt>        &lt;stream id="0" mode="widescreen"/&gt;</tt><tt><br>
      </tt><tt>        &lt;stream id="1" mode="letterbox"/&gt;</tt><tt><br>
      </tt><tt>      &lt;/subpicture&gt;</tt><tt><br>
      </tt><tt>      &lt;!--************** MENU 1 **************--&gt;</tt><tt><br>
      </tt><tt>      &lt;pgc entry="root"&gt;</tt><tt><br>
      </tt><tt>        &lt;button name="button01"&gt;jump title
        1;&lt;/button&gt;</tt><tt><br>
      </tt><tt>        &lt;button name="button02"&gt;jump vmgm menu
        1;&lt;/button&gt;</tt><tt><br>
      </tt><tt>        &lt;vob file="C:\dvd\tmp\dvd-tmp\menu1-0.mpg"
        pause="inf"/&gt;</tt><tt><br>
      </tt><tt>        &lt;pre&gt;g4=1; if(g3!=0){g4=2; jump menu 2;}
        button=g4*1024;&lt;/pre&gt;</tt><tt><br>
      </tt><tt>      &lt;/pgc&gt;</tt><tt><br>
      </tt><tt>      &lt;!--************** MENU 2 **************--&gt;</tt><tt><br>
      </tt><tt>      &lt;pgc entry="ptt"&gt;</tt><tt><br>
      </tt><tt>        &lt;button name="button01"&gt;jump title
        1;&lt;/button&gt;</tt><tt><br>
      </tt><tt>        &lt;button name="button02"&gt;jump title 1
        chapter 2;&lt;/button&gt;</tt><tt><br>
      </tt><tt>        &lt;vob file="C:\dvd\tmp\dvd-tmp\menu1-1.mpg"
        pause="inf"/&gt;</tt><tt><br>
      </tt><tt>        &lt;pre&gt;button=g4*1024;&lt;/pre&gt;</tt><tt><br>
      </tt><tt>      &lt;/pgc&gt;</tt><tt><br>
      </tt><tt>    &lt;/menus&gt;</tt><tt><br>
      </tt><tt>    &lt;titles&gt;</tt><tt><br>
      </tt><tt>      &lt;video aspect="16:9" widescreen="nopanscan"/&gt;</tt><tt><br>
      </tt><tt>      &lt;audio lang="DE"/&gt;</tt><tt><br>
      </tt><tt>      &lt;!--************** TITLE 1 **************--&gt;</tt><tt><br>
      </tt><tt>      &lt;pgc&gt;</tt><tt><br>
      </tt><tt>        &lt;vob file="C:\dvd\tmp\dvd-cache\entry001.vob"
        chapters="0:00,0:06"/&gt;</tt><tt><br>
      </tt><tt>        &lt;post&gt;call menu;&lt;/post&gt;</tt><tt><br>
      </tt><tt>      &lt;/pgc&gt;</tt><tt><br>
      </tt><tt>    &lt;/titles&gt;</tt><tt><br>
      </tt><tt>  &lt;/titleset&gt;</tt><tt><br>
      </tt><tt>&lt;/dvdauthor&gt;</tt><tt><br>
      </tt> <br>
    </div>
    <br>
  </body>
</html>

--------------080906080000020402020707--


--===============0849327120815839983==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
--===============0849327120815839983==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Dvdauthor-users mailing list
Dvdauthor-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/dvdauthor-users

--===============0849327120815839983==--