865eecb739
This causes the thread to only start when the IMediaFilter::Run/Pause calls have been made, and stop whenever either the IMediaFilter::Stop call has been made, or on destruction, whichever comes first. This potentially will work around a suspected race condition that appears to be in the WebRTC library where the filter's library will be released while the filter is in the process of being destroyed, which can take longer than usual if the join takes too long. Basically, fixes a reported crash (that doesn't appear to technically be our fault) when the filter is used with browsers when the virtualcam is deactivating in web browsers.