View Single Post
Old 18th June 2008, 01:16   #7  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Thanks, gzarkadas, I'm glad to see you are at least provisionally persuaded.

I can't try out your version yet (attachment still pending approval), but while you were doing that I also wrote a small plugin to verify my solution. Basically it is just a wrapper that calls the real ScriptClip's GetFrame (so it implements the latter's full functionality).

The GetFrame code is just:
Code:
AVSValue prevFrame;

try {
  prevFrame = env->GetVar("current_frame");
}
catch (IScriptEnvironment::NotFound) {}

PVideoFrame result = inner->GetFrame(n, env);

if (prevFrame.Defined())
  env->SetVar("current_frame", prevFrame);

return result;
where inner is a PClip representing the real ScriptClip and saved in my filter's constructor.

Seems to work OK.
Next step is to try making current_frame global...
Gavino is offline   Reply With Quote