title: Deadlocked in windows filter graph
body: <p>this is a hard to reproduce bug, but I finally managed to reproduce it. However, I do not have a clear understanding of what might have caused it.  I am currently trying to push myself through this bug and figure out the source of error. </p>
  
  <p>Wondering if someone can give me some directions or hints.</p>
  
  <hr>
  
  <p>My program is deadlocked in the stop function in Directshow Filter graph. </p>
  
  <p>here is the call stack:</p>
  
  <pre><code>ntdll.dll!_ZwDeviceIoControlFile@40()  + 0x15 bytes 
  ntdll.dll!_ZwDeviceIoControlFile@40()  + 0x15 bytes 
  KernelBase.dll!_CreateEventExW@16()  + 0x6e bytes   
  ksproxy.ax!SetState()  + 0x3e bytes 
  ksproxy.ax!Inactive()  + 0x3d bytes 
  </code></pre>
  
  <blockquote>
    <p>ksproxy.ax!CKsOutputPin::Inactive()  + 0x1d bytes<br>
        ksproxy.ax!CKsProxy::Stop()  + 0x59 bytes<br>
        quartz.dll!CFilterGraph::Stop()  + 0x123f3 bytes<br>
        <strong>quartz.dll!CFGControl::CImplMediaControl::Stop()  + 0x12dba bytes</strong>    &lt;--- Called into direct show
        *cam.dll!UVCCamera::Shutdown()  Line 140 + 0x1b bytes   C++
        cam.dll!<code>anonymous namespace'::closeCamera(unsigned int hCamera)  Line 297  C++
        cam.dll!</code>anonymous namespace'::CoreThreadFunc(void * data)  Line 916 + 0xb bytes    C++
        kernel32.dll!@BaseThreadInitThunk@12()  + 0x12 bytes<br>
        ntdll.dll!__<em>RtlUserThreadStart@8()  + 0x27 bytes<br>
        ntdll.dll!</em>_RtlUserThreadStart@8()  + 0x1b bytes*   </p>
  </blockquote>