Zebediah Figura : strmbase: Avoid unnecessary use of IPin::ConnectedTo().

Alexandre Julliard julliard at winehq.org
Tue Nov 19 16:35:21 CST 2019


Module: wine
Branch: master
Commit: cc78d104054378570b0d4a244efb5a3e95b92cb0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cc78d104054378570b0d4a244efb5a3e95b92cb0

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Nov 18 18:51:24 2019 -0600

strmbase: Avoid unnecessary use of IPin::ConnectedTo().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/strmbase/outputqueue.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/dlls/strmbase/outputqueue.c b/dlls/strmbase/outputqueue.c
index ee05653d7a..dbcc4b6d0d 100644
--- a/dlls/strmbase/outputqueue.c
+++ b/dlls/strmbase/outputqueue.c
@@ -177,6 +177,8 @@ VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue)
 
 VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue)
 {
+    IPin *peer;
+
     EnterCriticalSection(&pOutputQueue->csQueue);
     if (pOutputQueue->hThread)
     {
@@ -191,16 +193,8 @@ VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue)
         qev->pSample = NULL;
         list_add_tail(&pOutputQueue->SampleList, &qev->entry);
     }
-    else
-    {
-        IPin* ppin = NULL;
-        IPin_ConnectedTo(&pOutputQueue->pInputPin->pin.IPin_iface, &ppin);
-        if (ppin)
-        {
-            IPin_EndOfStream(ppin);
-            IPin_Release(ppin);
-        }
-    }
+    else if ((peer = pOutputQueue->pInputPin->pin.peer))
+        IPin_EndOfStream(peer);
     LeaveCriticalSection(&pOutputQueue->csQueue);
     /* Covers sending the Event to the worker Thread */
     OutputQueue_SendAnyway(pOutputQueue);
@@ -259,13 +253,9 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue)
                     QueuedEvent *qev = LIST_ENTRY(cursor, QueuedEvent, entry);
                     if (qev->type == EOS_PACKET)
                     {
-                        IPin* ppin = NULL;
-                        IPin_ConnectedTo(&pOutputQueue->pInputPin->pin.IPin_iface, &ppin);
-                        if (ppin)
-                        {
-                            IPin_EndOfStream(ppin);
-                            IPin_Release(ppin);
-                        }
+                        IPin *peer;
+                        if ((peer = pOutputQueue->pInputPin->pin.peer))
+                            IPin_EndOfStream(peer);
                     }
                     else if (qev->type == SAMPLE_PACKET)
                         break;




More information about the wine-cvs mailing list