From 06b4363991ae1340ab7d5e00a0866cf0a1e2c497 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 23 Aug 2017 14:02:35 +0200 Subject: Simplify :Stop, wrap original function instead of replacing it --- decoder/LAVVideo/LAVVideo.cpp | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index 7b6d3967..2cacd37d 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -1024,39 +1024,8 @@ STDMETHODIMP CLAVVideo::Stop() m_bFlushing = TRUE; } - CAutoLock lck1(&m_csFilter); - if (m_State == State_Stopped) { - return NOERROR; - } - - // Succeed the Stop if we are not completely connected - ASSERT(m_pInput == NULL || m_pOutput != NULL); - if (m_pInput == NULL || m_pInput->IsConnected() == FALSE || m_pOutput->IsConnected() == FALSE) { - m_State = State_Stopped; - m_bEOSDelivered = FALSE; - return NOERROR; - } - - ASSERT(m_pInput); - ASSERT(m_pOutput); - - // decommit the input pin before locking or we can deadlock - m_pInput->Inactive(); - - // synchronize with Receive calls - - CAutoLock lck2(&m_csReceive); - m_pOutput->Inactive(); - - // allow a class derived from CTransformFilter - // to know about starting and stopping streaming - - HRESULT hr = StopStreaming(); - if (SUCCEEDED(hr)) { - // complete the state transition - m_State = State_Stopped; - m_bEOSDelivered = FALSE; - } + // actually perform the stop + HRESULT hr = __super::Stop(); // unblock delivery again, if we continue receiving frames m_bFlushing = FALSE; -- cgit v1.2.3