amstream: Call IMediaStreamFilter::EndOfStream when streams receive EOS.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2021-04-20 00:22:53 +07:00 committed by Alexandre Julliard
parent 1296b0efb5
commit 9a0027dbba
3 changed files with 12 additions and 2 deletions

View File

@ -1157,6 +1157,11 @@ static HRESULT WINAPI audio_sink_EndOfStream(IPin *iface)
LeaveCriticalSection(&stream->cs);
/* Calling IMediaStreamFilter::EndOfStream() inside the critical section
* would invert the locking order, so we must leave it first to avoid
* the streaming thread deadlocking on the filter's critical section. */
IMediaStreamFilter_EndOfStream(stream->filter);
return S_OK;
}

View File

@ -1177,6 +1177,11 @@ static HRESULT WINAPI ddraw_sink_EndOfStream(IPin *iface)
LeaveCriticalSection(&stream->cs);
/* Calling IMediaStreamFilter::EndOfStream() inside the critical section
* would invert the locking order, so we must leave it first to avoid
* the streaming thread deadlocking on the filter's critical section. */
IMediaStreamFilter_EndOfStream(stream->filter);
return S_OK;
}

View File

@ -6127,8 +6127,8 @@ static void check_ammediastream_end_of_stream(const CLSID *clsid, const MSPID *i
hr = IPin_EndOfStream(pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(graph.got_notify == 1, "Got %d calls to IMediaEventSink::Notify().\n", graph.got_notify);
todo_wine ok(graph.event_code == EC_COMPLETE, "Got event code %d.\n", graph.event_code);
ok(graph.got_notify == 1, "Got %d calls to IMediaEventSink::Notify().\n", graph.got_notify);
ok(graph.event_code == EC_COMPLETE, "Got event code %d.\n", graph.event_code);
hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP);
ok(hr == S_OK, "Got hr %#x.\n", hr);