MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / Release

Method Release

Source/MediaSampleSideData.cpp:46–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46STDMETHODIMP_(ULONG) CMediaSampleSideData::Release()
47{
48 /* Decrement our own private reference count */
49 LONG lRef;
50 if (m_cRef == 1) {
51 lRef = 0;
52 m_cRef = 0;
53 }
54 else {
55 lRef = InterlockedDecrement(&m_cRef);
56 }
57 ASSERT(lRef >= 0);
58
59 /* Did we release our final reference count */
60 if (lRef == 0) {
61 /* Free all resources */
62 if (m_dwFlags & Sample_TypeChanged) {
63 SetMediaType(NULL);
64 }
65 ASSERT(m_pMediaType == NULL);
66 m_dwFlags = 0;
67 m_dwTypeSpecificFlags = 0;
68 m_dwStreamId = AM_STREAM_MEDIA;
69
70 ReleaseSideData();
71
72 /* This may cause us to be deleted */
73 // Our refcount is reliably 0 thus no-one will mess with us
74 m_pAllocator->ReleaseBuffer(this);
75 }
76 return (ULONG)lRef;
77}
78
79void CMediaSampleSideData::ReleaseSideData()
80{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected