Handle leak when opening video files
|Reported by:||fortune||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
I'm using the delphi ffmpeg components (http://www.delphiffmpeg.com/) which make use of ffmpeg dlls to encode and decode video.
I've already reported this problem to the author of the delphi components but he says the problem lies with the ffmpeg dlls and there's nothing he can do.
The problem is that the handle count (as viewed via task manager) keeps increasing whenever a video file is opened. This only happens on multithreaded CPUs and appears to be thread related. If the application runs for long enough it will eventually crash due to the handle leak.
A workaround that I've found is to force the application to only use a single CPU via the SetProcessAffinityMask function:
This works but the performance suffers due to only one cpu being used.
To reproduce this problem download the FFVCL trial from:
Included in the trial is the [MemoryPlayerDemo].exe demo file that uses ffmpeg DLLs. Start it and watch the task manager handle count when opening a video file. You'll see that it keeps increasing. Setting the process affinity to use one CPU stops the problem.
I hope you can help!