wonkey_monkey
7th June 2020, 16:37
https://pastebin.com/w5h1ksny
This is some code for a basic caching filter I wrote to speed up a random access filter.
I'm currently using it as part of a complex script, and for some reason it seems to be causing a crash (I also can't rule out the child filter yet, but removing the call to this filter also stops the crash).
And by "crash" I mean the host program, either VirtualDub, AvsMeter64, or my own, just disappears completely without so much as an exception.
I'm calling it with:
FrameCache(0, 40, true)
which should cause it to preload and cache frames 0-40 of the passed clip. This should only need about 128mb of RAM (I've got 24Gb of it to play with).
One odd thing I've noticed is that, for some reason, during the caching filter's constructor the passed ("child", I still think that's poor terminology though!) clip's GetFrame is called three times in a row for frame 0, without ever returning to the calling point (line 33 in the file). It only gets called once for all the other frames.
Usually it crashes after the first or second GetFrame for frame 0 of the child clip, but it's one of those weird ones where adding more debugging output lines seems to stop the crash happening.
Edit: running AvsMeter64, because it crashes memory usage peaks at about 1.5Gb, so it doesn't seem to be a memory problem.
Anyone got any clues? Is what I'm doing liable to be an abuse of PVideoFrame?
This is some code for a basic caching filter I wrote to speed up a random access filter.
I'm currently using it as part of a complex script, and for some reason it seems to be causing a crash (I also can't rule out the child filter yet, but removing the call to this filter also stops the crash).
And by "crash" I mean the host program, either VirtualDub, AvsMeter64, or my own, just disappears completely without so much as an exception.
I'm calling it with:
FrameCache(0, 40, true)
which should cause it to preload and cache frames 0-40 of the passed clip. This should only need about 128mb of RAM (I've got 24Gb of it to play with).
One odd thing I've noticed is that, for some reason, during the caching filter's constructor the passed ("child", I still think that's poor terminology though!) clip's GetFrame is called three times in a row for frame 0, without ever returning to the calling point (line 33 in the file). It only gets called once for all the other frames.
Usually it crashes after the first or second GetFrame for frame 0 of the child clip, but it's one of those weird ones where adding more debugging output lines seems to stop the crash happening.
Edit: running AvsMeter64, because it crashes memory usage peaks at about 1.5Gb, so it doesn't seem to be a memory problem.
Anyone got any clues? Is what I'm doing liable to be an abuse of PVideoFrame?