MCPcopy Create free account
hub / github.com/Nevcairiel/LAVFilters / Insert

Method Insert

common/baseclasses/ctlutil.cpp:1953–1991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1951}
1952
1953HRESULT
1954CCmdQueue::Insert(__in CDeferredCommand *pCmd)
1955{
1956 CAutoLock lock(&m_Lock);
1957
1958 // addref the item
1959 pCmd->AddRef();
1960
1961 CGenericList<CDeferredCommand> *pList;
1962 if (pCmd->IsStreamTime())
1963 {
1964 pList = &m_listStream;
1965 }
1966 else
1967 {
1968 pList = &m_listPresentation;
1969 }
1970 POSITION pos = pList->GetHeadPosition();
1971
1972 // seek past all items that are before us
1973 while (pos && (pList->GetValid(pos)->GetTime() <= pCmd->GetTime()))
1974 {
1975
1976 pList->GetNext(pos);
1977 }
1978
1979 // now at end of list or in front of items that come later
1980 if (!pos)
1981 {
1982 pList->AddTail(pCmd);
1983 }
1984 else
1985 {
1986 pList->AddBefore(pos, pCmd);
1987 }
1988
1989 SetTimeAdvise();
1990 return S_OK;
1991}
1992
1993HRESULT
1994CCmdQueue::Remove(__in CDeferredCommand *pCmd)

Callers 2

CDeferredCommandMethod · 0.80
PostponeMethod · 0.80

Calls 8

IsStreamTimeMethod · 0.80
GetHeadPositionMethod · 0.80
GetValidMethod · 0.80
GetNextMethod · 0.80
AddRefMethod · 0.45
GetTimeMethod · 0.45
AddTailMethod · 0.45
AddBeforeMethod · 0.45

Tested by

no test coverage detected