Maarten Lankhorst : quartz: Fix end of stream handling.

Alexandre Julliard julliard at winehq.org
Thu Jul 10 08:58:22 CDT 2008


Module: wine
Branch: master
Commit: 43d0acd26a6f396a9f2e0d90a38f5156fb86b415
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=43d0acd26a6f396a9f2e0d90a38f5156fb86b415

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed Jul  9 10:19:20 2008 -0700

quartz: Fix end of stream handling.

Flushing blocks any end of stream that may occur.

---

 dlls/quartz/pin.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c
index 9dedcb2..bb562ad 100644
--- a/dlls/quartz/pin.c
+++ b/dlls/quartz/pin.c
@@ -120,6 +120,11 @@ static HRESULT SendFurther( IPin *from, SendPinFunc fnMiddle, LPVOID arg, SendPi
             }
             IPin_Release( pin );
         }
+        else
+        {
+            hr = S_OK;
+            break;
+        }
     }
 
     if (!foundend)
@@ -622,12 +627,21 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
 
 HRESULT WINAPI InputPin_EndOfStream(IPin * iface)
 {
+    HRESULT hr = S_OK;
     InputPin *This = (InputPin *)iface;
+
     TRACE("(%p)\n", This);
 
-    This->end_of_stream = 1;
+    EnterCriticalSection(This->pin.pCritSec);
+    if (This->flushing)
+        hr = S_FALSE;
+    else
+        This->end_of_stream = 1;
+    LeaveCriticalSection(This->pin.pCritSec);
 
-    return SendFurther( iface, deliver_endofstream, NULL, NULL );
+    if (hr == S_OK)
+        hr = SendFurther( iface, deliver_endofstream, NULL, NULL );
+    return hr;
 }
 
 static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
@@ -665,7 +679,7 @@ HRESULT WINAPI InputPin_EndFlush(IPin * iface)
     TRACE("(%p)\n", This);
 
     EnterCriticalSection(This->pin.pCritSec);
-    This->flushing = 0;
+    This->flushing = This->end_of_stream = 0;
 
     hr = SendFurther( iface, deliver_endflush, NULL, NULL );
     LeaveCriticalSection(This->pin.pCritSec);
@@ -1774,7 +1788,7 @@ HRESULT WINAPI PullPin_EndFlush(IPin * iface)
         FILTER_STATE state;
         IBaseFilter_GetState(This->pin.pinInfo.pFilter, INFINITE, &state);
 
-        if (This->stop_playback && state != State_Stopped)
+        if (state != State_Stopped)
             PullPin_StartProcessing(This);
 
         PullPin_WaitForStateChange(This, INFINITE);




More information about the wine-cvs mailing list