View Single Post
Old 2008-06-29, 21:58   Link #188
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 37
worng:
Code:
$end+800
right:
Code:
!$end+800!
$-variables can be used anywhere, but all calculations must be enclosed in !! (used to be %% in automation 3) or they will not be evaluated as Lua expressions.

What happens with your current code is that (if we assume that $end is 500) \t($end,$end+800) gets expanded to the literal string \t(500,500+800) and since VSFilter doesn't do any arithmetic calculations on the override tag arguments itself, it will most likely just call one of the C standard functions atof() or atoi() on each of the two first \t arguments. This in turn happily reads "500" in the first case, reads "500" again in the second and then skips all the garbage that doesn't look like it's part of the number at the end of the string (that is, everything after and including the + sign). In other words your current code will generate output that is interpreted as \t($end,$end) which is obviously not what you want. You could have figured out the solution to this problem pretty quick if you had bothered to look closer at the generated output. End of tl;dr.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read

Last edited by TheFluff; 2008-06-29 at 22:13.
TheFluff is offline   Reply With Quote