On Fri Nov 3 18:14:45 2023 +0000, Yuxuan Shui wrote:
Adding to point (2), even if we can fix this now by not holding grabber lock while calling `OnProcessSample`, we might introduce more deadlocks of the same kind in the future. This MR is more future proof in that sense.
I was able to block engine shutdown by injecting a media source via `IMFMediaEngineExtension`. While the engine shutdown is blocked, I was able to call engine shutdown again from a different thread, and the second shutdown returns `MF_E_SHUTDOWN` immediately.
This mean either engine lock is not held; or engine shutdown flag is not protected by a lock, maybe an atomic. I think this is more evidence this MR should be accepted.