HRESULT CBaseSplitterFilter::DeleteOutputs() { m_rtDuration = 0; m_pRetiredOutputs.RemoveAll(); CAutoLock cAutoLockF(this); if(m_State != State_Stopped) return VFW_E_NOT_STOPPED; while(m_pOutputs.GetCount()) { CAutoPtr<CBaseSplitterOutputPin> pPin = m_pOutputs.RemoveHead(); if(IPin* pPinTo = pPin->GetConnected()) pPinTo->Disconnect(); pPin->Disconnect(); // we can't just let it be deleted now, something might have AddRefed on it (graphedit...) m_pRetiredOutputs.AddTail(pPin); } CAutoLock cAutoLockPM(&m_csPinMap); m_pPinMap.RemoveAll(); CAutoLock cAutoLockMT(&m_csmtnew); m_mtnew.RemoveAll(); RemoveAll(); ResRemoveAll(); ChapRemoveAll(); m_fontinst.UninstallFonts(); m_pSyncReader.Release(); return S_OK; }
STDMETHODIMP CVTSReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt) { if (!m_stream.Load(pszFileName)) { return E_FAIL; } ChapRemoveAll(); for (int i = 0; i < m_stream.GetChaptersCount(); i++) { CString chap; chap.Format(_T("Chapter %d"), i + 1); ChapAppend(m_stream.GetChapterOffset(i), chap); } m_fn = pszFileName; CMediaType mt; mt.majortype = MEDIATYPE_Stream; mt.subtype = MEDIASUBTYPE_MPEG2_PROGRAM; m_mt = mt; return S_OK; }