While working on something else, I discovered that tsfilesource destructor is always crashing when releasing its filter's graph. The exception is caught inside Marshal.ReleaseComObject call, so nobody can see this crash.
All this happens in Cleanup() method of TStreamBufferPlayer9, which looks like this:
I found that if _vmr9 is released after tsfilesource, the crash is gone! Don't know what exactly _vmr9 is doing that causes the crash.
Here is the patch on sourceforge.
All this happens in Cleanup() method of TStreamBufferPlayer9, which looks like this:
Code:
...
if (_vmr9 != null)
{
Log.Info("TSStreamBufferPlayer9: vmr9 dispose");
_vmr9.Dispose();
_vmr9 = null;
}
...
DirectShowUtil.RemoveFilters(_graphBuilder); //here tsfilesource is released
....
I found that if _vmr9 is released after tsfilesource, the crash is gone! Don't know what exactly _vmr9 is doing that causes the crash.
Here is the patch on sourceforge.