quartz: Fix EC_COMPLETE handling on dsound renderer.
This commit is contained in:
parent
6b35b5dd37
commit
89223ff78b
@ -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
|
|||||||
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)
|
|||||||
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,22 +826,23 @@ static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = IFilterGraph_QueryInterface(me->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
|
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
{
|
|
||||||
BYTE * silence;
|
|
||||||
|
|
||||||
silence = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, me->buf_size);
|
silence = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, me->buf_size);
|
||||||
if (silence)
|
if (silence)
|
||||||
{
|
{
|
||||||
memset(silence, 0, me->buf_size);
|
memset(silence, 0, me->buf_size);
|
||||||
DSoundRender_SendSampleData((DSoundRenderImpl*)This->pin.pinInfo.pFilter, silence, me->buf_size);
|
DSoundRender_SendSampleData(me, silence, me->buf_size);
|
||||||
HeapFree(GetProcessHeap(), 0, silence);
|
HeapFree(GetProcessHeap(), 0, silence);
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
|
if (me->filter.filterInfo.pGraph)
|
||||||
|
{
|
||||||
|
hr = IFilterGraph_QueryInterface(me->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)me);
|
||||||
IMediaEventSink_Release(pEventSink);
|
IMediaEventSink_Release(pEventSink);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
MediaSeekingPassThru_EOS(me->seekthru_unk);
|
MediaSeekingPassThru_EOS(me->seekthru_unk);
|
||||||
LeaveCriticalSection(This->pin.pCritSec);
|
LeaveCriticalSection(This->pin.pCritSec);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user