[PATCH 2/4] winegstreamer: Make GSTOutPin_BreakConnect() a local helper.

Zebediah Figura z.figura12 at gmail.com
Sat May 11 14:46:19 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/winegstreamer/gstdemux.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 8b167483f6..9a3e1e798b 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1825,7 +1825,7 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(BaseOutputPin *iface, IMemInputP
     return hr;
 }
 
-static HRESULT WINAPI GSTOutPin_BreakConnect(BaseOutputPin *This)
+static HRESULT break_source_connection(BaseOutputPin *This)
 {
     HRESULT hr;
 
@@ -1836,7 +1836,9 @@ static HRESULT WINAPI GSTOutPin_BreakConnect(BaseOutputPin *This)
         hr = VFW_E_NOT_CONNECTED;
     else
     {
-        hr = IPin_Disconnect(This->pin.pConnectedTo);
+        hr = IMemAllocator_Decommit(This->pAllocator);
+        if (SUCCEEDED(hr))
+            hr = IPin_Disconnect(This->pin.pConnectedTo);
         IPin_Disconnect((IPin *)This);
     }
     LeaveCriticalSection(This->pin.pCritSec);
@@ -1873,7 +1875,7 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
     BaseOutputPinImpl_AttemptConnection,
     GSTOutPin_DecideBufferSize,
     GSTOutPin_DecideAllocator,
-    GSTOutPin_BreakConnect
+    NULL,
 };
 
 static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDIA_TYPE *amt)
@@ -1916,7 +1918,7 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This)
     This->my_src = This->their_sink = NULL;
 
     for (i = 0; i < This->cStreams; i++) {
-        hr = BaseOutputPinImpl_BreakConnect(&This->ppPins[i]->pin);
+        hr = break_source_connection(&This->ppPins[i]->pin);
         TRACE("Disconnect: %08x\n", hr);
         IPin_Release(&This->ppPins[i]->pin.pin.IPin_iface);
     }
-- 
2.21.0




More information about the wine-devel mailing list