mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 06:21:15 +00:00
amstream: Call IMediaStreamFilter::Flush in IPin::BeginFlush.
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:
parent
35fc7319e2
commit
1917fe0e07
|
@ -1168,17 +1168,25 @@ static HRESULT WINAPI audio_sink_EndOfStream(IPin *iface)
|
|||
static HRESULT WINAPI audio_sink_BeginFlush(IPin *iface)
|
||||
{
|
||||
struct audio_stream *stream = impl_from_IPin(iface);
|
||||
BOOL cancel_eos;
|
||||
|
||||
TRACE("stream %p.\n", stream);
|
||||
|
||||
EnterCriticalSection(&stream->cs);
|
||||
|
||||
cancel_eos = stream->eos;
|
||||
|
||||
stream->flushing = TRUE;
|
||||
stream->eos = FALSE;
|
||||
flush_receive_queue(stream);
|
||||
|
||||
LeaveCriticalSection(&stream->cs);
|
||||
|
||||
/* Calling IMediaStreamFilter::Flush() inside the critical section would
|
||||
* invert the locking order, so we must leave it first to avoid the
|
||||
* application thread deadlocking on the filter's critical section. */
|
||||
IMediaStreamFilter_Flush(stream->filter, cancel_eos);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1188,17 +1188,25 @@ static HRESULT WINAPI ddraw_sink_EndOfStream(IPin *iface)
|
|||
static HRESULT WINAPI ddraw_sink_BeginFlush(IPin *iface)
|
||||
{
|
||||
struct ddraw_stream *stream = impl_from_IPin(iface);
|
||||
BOOL cancel_eos;
|
||||
|
||||
TRACE("stream %p.\n", stream);
|
||||
|
||||
EnterCriticalSection(&stream->cs);
|
||||
|
||||
cancel_eos = stream->eos;
|
||||
|
||||
stream->flushing = TRUE;
|
||||
stream->eos = FALSE;
|
||||
WakeConditionVariable(&stream->update_queued_cv);
|
||||
|
||||
LeaveCriticalSection(&stream->cs);
|
||||
|
||||
/* Calling IMediaStreamFilter::Flush() inside the critical section would
|
||||
* invert the locking order, so we must leave it first to avoid the
|
||||
* application thread deadlocking on the filter's critical section. */
|
||||
IMediaStreamFilter_Flush(stream->filter, cancel_eos);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -4214,7 +4214,7 @@ static void test_audiostream_begin_flush_end_flush(void)
|
|||
hr = IPin_EndOfStream(pin2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
todo_wine ok(graph.got_notify == 0, "Got %d calls to IMediaEventSink::Notify().\n", graph.got_notify);
|
||||
ok(graph.got_notify == 0, "Got %d calls to IMediaEventSink::Notify().\n", graph.got_notify);
|
||||
|
||||
hr = IPin_EndOfStream(pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
@ -4248,8 +4248,8 @@ static void test_audiostream_begin_flush_end_flush(void)
|
|||
hr = IPin_EndOfStream(pin2);
|
||||
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);
|
||||
|
@ -5808,7 +5808,7 @@ static void test_ddrawstream_begin_flush_end_flush(void)
|
|||
hr = IPin_EndOfStream(pin2);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
todo_wine ok(graph.got_notify == 0, "Got %d calls to IMediaEventSink::Notify().\n", graph.got_notify);
|
||||
ok(graph.got_notify == 0, "Got %d calls to IMediaEventSink::Notify().\n", graph.got_notify);
|
||||
|
||||
hr = IPin_EndOfStream(pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
@ -5842,8 +5842,8 @@ static void test_ddrawstream_begin_flush_end_flush(void)
|
|||
hr = IPin_EndOfStream(pin2);
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue