[QUARTZ][STRMBASE]
[reactos.git] / reactos / lib / 3rdparty / strmbase / renderer.c
index 1815f0f..cf2f318 100644 (file)
@@ -217,15 +217,14 @@ static const BaseFilterFuncTable RendererBaseFilterFuncTable = {
     BaseRenderer_GetPinCount
 };
 
-static const  BasePinFuncTable input_BaseFuncTable = {
-    BaseRenderer_Input_CheckMediaType,
-    NULL,
-    BasePinImpl_GetMediaTypeVersion,
-    BasePinImpl_GetMediaType
-};
-
 static const BaseInputPinFuncTable input_BaseInputFuncTable = {
-   BaseRenderer_Receive
+    {
+        BaseRenderer_Input_CheckMediaType,
+        NULL,
+        BasePinImpl_GetMediaTypeVersion,
+        BasePinImpl_GetMediaType
+    },
+    BaseRenderer_Receive
 };
 
 
@@ -243,7 +242,8 @@ HRESULT WINAPI BaseRenderer_Init(BaseRenderer * This, const IBaseFilterVtbl *Vtb
     piInput.pFilter = &This->filter.IBaseFilter_iface;
     lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
 
-    hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, &piInput, &input_BaseFuncTable, &input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin);
+    hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, sizeof(BaseInputPin), &piInput,
+            &input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin);
 
     if (SUCCEEDED(hr))
     {
@@ -284,7 +284,7 @@ HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter* iface, REFIID riid,
 ULONG WINAPI BaseRendererImpl_Release(IBaseFilter* iface)
 {
     BaseRenderer *This = impl_from_IBaseFilter(iface);
-    ULONG refCount = BaseFilterImpl_Release(iface);
+    ULONG refCount = InterlockedDecrement(&This->filter.refCount);
 
     if (!refCount)
     {
@@ -309,6 +309,7 @@ ULONG WINAPI BaseRendererImpl_Release(IBaseFilter* iface)
         CloseHandle(This->ThreadSignal);
         CloseHandle(This->RenderEvent);
         QualityControlImpl_Destroy(This->qcimpl);
+        BaseFilter_Destroy(&This->filter);
     }
     return refCount;
 }
@@ -461,7 +462,7 @@ HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
 
     if (This->pInputPin->pin.pConnectedTo)
     {
-        This->pInputPin->end_of_stream = 0;
+        This->pInputPin->end_of_stream = FALSE;
     }
     else if (This->filter.filterInfo.pGraph)
     {
@@ -504,7 +505,7 @@ HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface)
             {
                 if (This->pInputPin->pin.pConnectedTo)
                     ResetEvent(This->evComplete);
-                This->pInputPin->end_of_stream = 0;
+                This->pInputPin->end_of_stream = FALSE;
             }
             else if (This->pFuncsTable->pfnOnStopStreaming)
                 This->pFuncsTable->pfnOnStopStreaming(This);