问题
I have a Delphi 6 DirectShow application that exchanges audio with Skype via sockets. I am getting an intermittent access violation in one of the threads started by one of the DLLs loaded by the Filter Graph when the DirectShow filter chain is ran. As I discovered in a previous SO post with the help of another SO member, the thread that faults appears to be started by the Microsoft Audio Compression Manager (msacm32.dll):
How can I tell what DLL started a thread and what address space a DLL owns for an external DLL?
The error does not happen if I don't use compression. This makes sense since my filter graph only loads the ACM DLL if compression is actually turned on using a setting in my application. Therefore the **msacm32.dll* would not be loaded. However, if I don't exchange audio with Skype via sockets I don't seem to get the access violation, even if compression is in use. What complicates the issue is that if I have the sockets connected with Skype, but I never send any data to Skype or receive any data from it over those sockets, I still get the access violation. I determined this by commenting out the code that does the socket send and receive calls and noticed I still got the AV. However, if I don't connect to Skype at all via sockets then the AV doesn't seem to occur. I say "seem" because several hours of testing indicate that, but that's not proof of course.
NOTE: the AV is intermittent. It doesn't happen every time, but I never am able to run more than 5 trials in a row without it happening.
Has anyone ever had experience with getting an access violation when using the ACM in a DirectShow application? If so, what was the cause and how did you fix it?
来源:https://stackoverflow.com/questions/8310876/how-to-debug-an-access-violation-in-the-microsoft-audio-compression-manager-in-a