View Single Post
Old 4th September 2006, 03:51   #15  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Just an update

This is not really a bug so much as a restriction. Raymod's original script causes 720 instances of the SubTitile filter object to be created. In an attempt to minimise resource usage the GDI resources needed to paint the text are only created when the first frame to be subtitled is rendered. So as the clip plays, more and more GDI resources are allocated, until eventually they run out. The bug part of the problem is the code doesn't check the return codes and blindly uses a Null pointer.

As the resources are released 10 frames after the last frame needing subtitling is rendered the workaround causes that frame to be rendered and the GDI resources hence get released.

I have commited to CVS fixes for checking the return value, so now instead of getting a GPF you will get a runtime exception thrown, which for non AVS aware apps will produce frames rendered with an Error Text (assuming the total lack of global resources doesn't choke something else).

Also in an attempt to avoid the problem the GDI resources are explicitly released when the last frame of a clip is rendered as well as frames outside the span of 10.
IanB is offline   Reply With Quote