I have been evaluating the MPEG2 directshow codecs that are within the newly released Elecard MPEG player v4.0.2. I mentioned one bug already, but I came across another. There is an event handle leak. The act of rendering a graph for an MPEG2 file, playing that graph, stopping the graph, and releasing the graph loses two windows event handles. If you played a lot of movies over time, this will eventually cause a crash.
Using these Microsoft debugging tools:
Microsoft Application Verifier v3.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=BD02C19C-1250-433C-8C1B-2619BD93B3A2&displaylang=enDebugging Tools for Windows Current Release version 6.6.3.5 - January 24, 2006
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspxOh.exe: Open Handles
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/oh-o.aspI was able to track the leak down using !htrace in windbg. Both leaked events were created within em2vd, the Elecard MPEG2 video decoder filter. Here are details on the em2vd.ax I was using (note the first number, 04770000, is the address where em2vd was loaded):
04770000 0482e000 em2vd (deferred)
Image path: D:\Program Files\Common Files\Elecard\em2vd.ax
Image name: em2vd.ax
Timestamp: Tue Dec 13 04:06:23 2005 (439E8F0F)
CheckSum: 000CD139
ImageSize: 000BE000
File version: 1.0.172.51213
Product version: 1.0.172.51213
File flags: 28 (Mask 3F) Private Special
[...snipped...]
Here are the two handles !htrace said leaked:
--------------------------------------
Handle = 0x000001c0 - OPEN
Thread ID = 0x00000ffc, Process ID = 0x0000089c
0x7c80a6da: kernel32!CreateEventW+0x00000067
0x7c81e4df: kernel32!CreateEventA+0x00000068
0x00399a6e: vfbasics!AVrfpCreateEventA+0x0000007e
0x0478482a: em2vd!DllMain+0x0001034a
--------------------------------------
Handle = 0x000002a0 - OPEN
Thread ID = 0x00000ffc, Process ID = 0x0000089c
0x7c80a6da: kernel32!CreateEventW+0x00000067
0x7c81e4df: kernel32!CreateEventA+0x00000068
0x00399a6e: vfbasics!AVrfpCreateEventA+0x0000007e
0x0478481d: em2vd!DllMain+0x0001033d
Making all this happen in graphedit was a bit of a pain, so I have written a very crude sample program that renders a filter graph, plays it, stops it, and releases it, over and over. You are welcome to have this if you like.
It appears something in lc.dll was calling wcslen on unmapped address space, so it would crash about the same time lc.dll loaded. For the time being, I just renamed that dll which made the problem go away.
Note that if I uninstalled the Elecard player (and codecs), I was not able to produce this problem with other media types (I've tried MPEG1 files and Indeo5 AVI files), so it does not appear to be a bug in DirectShow, graphedit, or the example program I was using.
--Johno