martinfrombern
19th October 2009, 20:23
I created a function and in there are two global variables (clips) defined, because I use them in ScriptClip in the function. However, whenever I call this function two times, AvsP crashes. I tried making only the first call, or only the second and everything works as expected, but when called both all I got is AvsP crash.
function solim(clip clp1, clip clp2, int "x", int "y", int "lwidth", int "lheight")
{
(...)
global strip_down = clp1.crop(x, y, lheight, 2)
global strip_up = replacement.crop(0, lheight-2, -0, 2)
ScriptClip...
(...)
}
(...)
solim(last, denoised, 8)
solim(last, denoised, 59)The problem is definitely in these global variables, because when defining two functions instead of one, renaming second to solim1 and its variables to strip_down1 and strip_up1 and then calling solim and then solim1, everything works fine.
function solim(clip clp1, clip clp2, int "x", int "y", int "lwidth", int "lheight")
{
(...)
global strip_down = clp1.crop(x, y, lheight, 2)
global strip_up = replacement.crop(0, lheight-2, -0, 2)
ScriptClip...
(...)
}
(...)
solim(last, denoised, 8)
solim(last, denoised, 59)The problem is definitely in these global variables, because when defining two functions instead of one, renaming second to solim1 and its variables to strip_down1 and strip_up1 and then calling solim and then solim1, everything works fine.