Commit 82b86d47 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

strmbase: Defer EC_COMPLETE until the renderer is running.

parent e017e33a
...@@ -1143,7 +1143,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control) ...@@ -1143,7 +1143,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control)
hr = IMediaControl_GetState(control, 1000, &state); hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); ok(!ret, "Got unexpected EC_COMPLETE.\n");
hr = join_thread(send_frame(input)); hr = join_thread(send_frame(input));
todo_wine ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr); todo_wine ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr);
...@@ -1151,7 +1151,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control) ...@@ -1151,7 +1151,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control)
hr = IMediaControl_Run(control); hr = IMediaControl_Run(control);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_COMPLETE.\n"); ok(ret == 1, "Expected EC_COMPLETE.\n");
hr = IMediaControl_Stop(control); hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
...@@ -1295,7 +1295,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control) ...@@ -1295,7 +1295,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control)
hr = IMediaControl_GetState(control, 1000, &state); hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(!ret, "Got unexpected EC_COMPLETE.\n"); ok(!ret, "Got unexpected EC_COMPLETE.\n");
hr = join_thread(send_frame(input)); hr = join_thread(send_frame(input));
todo_wine ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr); todo_wine ok(hr == E_UNEXPECTED, "Got hr %#x.\n", hr);
...@@ -1303,7 +1303,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control) ...@@ -1303,7 +1303,7 @@ static void test_eos(IPin *pin, IMemInputPin *input, IMediaControl *control)
hr = IMediaControl_Run(control); hr = IMediaControl_Run(control);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
ret = check_ec_complete(eventsrc, 0); ret = check_ec_complete(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_COMPLETE.\n"); ok(ret == 1, "Expected EC_COMPLETE.\n");
hr = IMediaControl_Stop(control); hr = IMediaControl_Stop(control);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
...@@ -242,6 +242,8 @@ static HRESULT renderer_init_stream(struct strmbase_filter *iface) ...@@ -242,6 +242,8 @@ static HRESULT renderer_init_stream(struct strmbase_filter *iface)
static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TIME start) static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TIME start)
{ {
struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
IFilterGraph *graph = filter->filter.graph;
IMediaEventSink *event_sink;
filter->stream_start = start; filter->stream_start = start;
SetEvent(filter->state_event); SetEvent(filter->state_event);
...@@ -250,6 +252,15 @@ static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TI ...@@ -250,6 +252,15 @@ static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TI
if (filter->sink.pin.peer && filter->ops->renderer_start_stream) if (filter->sink.pin.peer && filter->ops->renderer_start_stream)
filter->ops->renderer_start_stream(filter); filter->ops->renderer_start_stream(filter);
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; return S_OK;
} }
...@@ -437,7 +448,8 @@ static HRESULT sink_eos(struct strmbase_sink *iface) ...@@ -437,7 +448,8 @@ static HRESULT sink_eos(struct strmbase_sink *iface)
filter->eos = TRUE; 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))) &IID_IMediaEventSink, (void **)&event_sink)))
{ {
IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK, IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
......
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