Commit 89223ff7 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Fix EC_COMPLETE handling on dsound renderer.

parent 6b35b5dd
...@@ -620,6 +620,7 @@ static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStar ...@@ -620,6 +620,7 @@ static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStar
TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart)); TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
EnterCriticalSection(&This->filter.csFilter); EnterCriticalSection(&This->filter.csFilter);
if (This->pInputPin->pin.pConnectedTo)
{ {
This->filter.rtStreamStart = tStart; This->filter.rtStreamStart = tStart;
if (This->filter.state == State_Paused) if (This->filter.state == State_Paused)
...@@ -633,9 +634,18 @@ static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStar ...@@ -633,9 +634,18 @@ static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStar
This->pInputPin->end_of_stream = 0; This->pInputPin->end_of_stream = 0;
} }
ResetEvent(This->blocked); ResetEvent(This->blocked);
} else if (This->filter.filterInfo.pGraph) {
This->filter.state = State_Running; IMediaEventSink *pEventSink;
hr = IFilterGraph_QueryInterface(This->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
if (SUCCEEDED(hr))
{
hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)This);
IMediaEventSink_Release(pEventSink);
}
hr = S_OK;
} }
if (SUCCEEDED(hr))
This->filter.state = State_Running;
LeaveCriticalSection(&This->filter.csFilter); LeaveCriticalSection(&This->filter.csFilter);
return hr; return hr;
...@@ -802,6 +812,7 @@ static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface) ...@@ -802,6 +812,7 @@ static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface)
BaseInputPin* This = (BaseInputPin*)iface; BaseInputPin* This = (BaseInputPin*)iface;
DSoundRenderImpl *me = (DSoundRenderImpl*)This->pin.pinInfo.pFilter; DSoundRenderImpl *me = (DSoundRenderImpl*)This->pin.pinInfo.pFilter;
IMediaEventSink* pEventSink; IMediaEventSink* pEventSink;
BYTE *silence;
HRESULT hr; HRESULT hr;
EnterCriticalSection(This->pin.pCritSec); EnterCriticalSection(This->pin.pCritSec);
...@@ -815,21 +826,22 @@ static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface) ...@@ -815,21 +826,22 @@ static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface)
return hr; return hr;
} }
hr = IFilterGraph_QueryInterface(me->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink); silence = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, me->buf_size);
if (SUCCEEDED(hr)) if (silence)
{ {
BYTE * silence; memset(silence, 0, me->buf_size);
DSoundRender_SendSampleData(me, silence, me->buf_size);
HeapFree(GetProcessHeap(), 0, silence);
}
silence = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, me->buf_size); if (me->filter.filterInfo.pGraph)
if (silence) {
hr = IFilterGraph_QueryInterface(me->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
if (SUCCEEDED(hr))
{ {
memset(silence, 0, me->buf_size); hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)me);
DSoundRender_SendSampleData((DSoundRenderImpl*)This->pin.pinInfo.pFilter, silence, me->buf_size); IMediaEventSink_Release(pEventSink);
HeapFree(GetProcessHeap(), 0, silence);
} }
hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
IMediaEventSink_Release(pEventSink);
} }
MediaSeekingPassThru_EOS(me->seekthru_unk); MediaSeekingPassThru_EOS(me->seekthru_unk);
LeaveCriticalSection(This->pin.pCritSec); LeaveCriticalSection(This->pin.pCritSec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment