Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/quartz/dsoundrender.c | 14 +++++++++++++- dlls/quartz/tests/dsoundrender.c | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 656a5e1f7ab..30884671838 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -461,7 +461,8 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface)
filter->eos = TRUE;
- if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph, + if (filter->filter.state == State_Running && graph + && SUCCEEDED(IFilterGraph_QueryInterface(graph, &IID_IMediaEventSink, (void **)&event_sink))) { IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK, @@ -599,6 +600,8 @@ static HRESULT dsound_render_init_stream(struct strmbase_filter *iface) static HRESULT dsound_render_start_stream(struct strmbase_filter *iface, REFERENCE_TIME start) { struct dsound_render *filter = impl_from_strmbase_filter(iface); + IFilterGraph *graph = filter->filter.graph; + IMediaEventSink *event_sink;
filter->stream_start = start;
@@ -610,6 +613,15 @@ static HRESULT dsound_render_start_stream(struct strmbase_filter *iface, REFEREN IDirectSoundBuffer_Play(filter->dsbuffer, 0, 0, DSBPLAY_LOOPING); }
+ if (filter->eos && graph + && SUCCEEDED(IFilterGraph_QueryInterface(graph, + &IID_IMediaEventSink, (void **)&event_sink))) + { + IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK, + (LONG_PTR)&filter->filter.IBaseFilter_iface); + IMediaEventSink_Release(event_sink); + } + return S_OK; }
diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index 093e901ffa4..41c5e7fde4e 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -922,7 +922,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control) hr = IMediaControl_GetState(control, 1000, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); ret = check_ec_complete(eventsrc, 0); - todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); + ok(!ret, "Got unexpected EC_COMPLETE.\n");
hr = send_frame(input); todo_wine ok(hr == VFW_E_SAMPLE_REJECTED_EOS, "Got hr %#x.\n", hr);