stickboy
29th March 2004, 13:26
I've been poking around in the AviSynth source to try to fix that pesky problem with *s in plug-in parameter strings. (For anyone not aware, for most cases the * modifier wasn't accepting zero matches. As a consequence, AviSynth didn't allow Animate/ApplyRange to be used with filters that take no arguments, nor did it allow SelectEvery(n) (which is supposed to be equivalent to SelectEvery(n, 0)).)
AFAICT, the following quick-fix seems to work:
In TypeMatch in avisynth.cpp, I changed:return ( *param_types == 0 || *param_types == '['
|| *param_types == '+' || *param_types == '*');
to:
return *param_types == '\0' || *param_types == '['
|| *param_types == '+' || param_types[0] == '*' || param_types[1] == '*';Yeah, it seems like a hack; I haven't noticed any problems so far, but this is certainly the type of change that ought to undergo more scrutiny. Can anyone think of any cases this change might break?
I also modified AddFunction to check the correctness of filters' parameter strings.
TypeMatchTest.zip (http://www.avisynth.org/stickboy/tmp/TypeMatchTest.zip) contains a modified avisynth.cpp (based on a version I checked out of CVS a few hours ago) along with a really basic command-line test harness for TypeMatch.
AFAICT, the following quick-fix seems to work:
In TypeMatch in avisynth.cpp, I changed:return ( *param_types == 0 || *param_types == '['
|| *param_types == '+' || *param_types == '*');
to:
return *param_types == '\0' || *param_types == '['
|| *param_types == '+' || param_types[0] == '*' || param_types[1] == '*';Yeah, it seems like a hack; I haven't noticed any problems so far, but this is certainly the type of change that ought to undergo more scrutiny. Can anyone think of any cases this change might break?
I also modified AddFunction to check the correctness of filters' parameter strings.
TypeMatchTest.zip (http://www.avisynth.org/stickboy/tmp/TypeMatchTest.zip) contains a modified avisynth.cpp (based on a version I checked out of CVS a few hours ago) along with a really basic command-line test harness for TypeMatch.