Thread: Avisynth+
View Single Post
Old 27th June 2016, 14:27   #1848  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
The VDub destructor bug isn't so easy to fix; but shouldn't be hard for someone who understands the code better.

Code:
  // VDubFilter.cpp
  void CallEndProc() {
    if (fd->endProc) {
      int result = fd->endProc(&fa, &g_filterFuncs);
      if (result != 0) {
        throw AvisynthError("VirtualdubFilterProxy: error calling endProc");
      }
    }
  }
Basically, Deshaker's EndProc is trying to access "something" within fa that is no longer accessible at that time.

Commenting both of these lines does solve the problem, but I doubt it is the right fix
Code:
// in FilterAdd
fm->env->AtExit(FreeFilterDefinition, fd);

// in LoadVirtualdubPlugin
env->AtExit(FreeFilterModule, fm);
The destructor needs to be called before these 2 functions.

I'll let you fix it before I start adding a "release timer" to fix the sequence

Last edited by MysteryX; 27th June 2016 at 14:51.
MysteryX is offline