static HRESULT WINAPI QT_Stop(IBaseFilter *iface) { QTSplitter *This = impl_from_IBaseFilter(iface); TRACE("()\n"); EnterCriticalSection(&This->csReceive); IAsyncReader_BeginFlush(This->pInputPin.pReader); IAsyncReader_EndFlush(This->pInputPin.pReader); LeaveCriticalSection(&This->csReceive); return S_OK; }
HRESULT WINAPI Parser_Stop(IBaseFilter * iface) { ParserImpl *This = impl_from_IBaseFilter(iface); PullPin *pin = impl_PullPin_from_IPin(This->ppPins[0]); ULONG i; TRACE("()\n"); EnterCriticalSection(&pin->thread_lock); IAsyncReader_BeginFlush(This->pInputPin->pReader); EnterCriticalSection(&This->filter.csFilter); if (This->filter.state == State_Stopped) { LeaveCriticalSection(&This->filter.csFilter); IAsyncReader_EndFlush(This->pInputPin->pReader); LeaveCriticalSection(&pin->thread_lock); return S_OK; } This->filter.state = State_Stopped; for (i = 1; i < (This->cStreams + 1); i++) { BaseOutputPinImpl_Inactive((BaseOutputPin *)This->ppPins[i]); } LeaveCriticalSection(&This->filter.csFilter); PullPin_PauseProcessing(This->pInputPin); PullPin_WaitForStateChange(This->pInputPin, INFINITE); IAsyncReader_EndFlush(This->pInputPin->pReader); LeaveCriticalSection(&pin->thread_lock); return S_OK; }