mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 10:43:38 +00:00
amstream: Implement MediaStreamFilter::Flush.
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
0c3bb47589
commit
4919b9b99f
|
@ -750,11 +750,28 @@ static HRESULT WINAPI filter_WaitUntil(IMediaStreamFilter *iface, REFERENCE_TIME
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI filter_Flush(IMediaStreamFilter *iface, BOOL bCancelEOS)
|
||||
static HRESULT WINAPI filter_Flush(IMediaStreamFilter *iface, BOOL cancel_eos)
|
||||
{
|
||||
FIXME("(%p)->(%d): Stub!\n", iface, bCancelEOS);
|
||||
struct filter *filter = impl_from_IMediaStreamFilter(iface);
|
||||
struct event *event;
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("filter %p, cancel_eos %d.\n", iface, cancel_eos);
|
||||
|
||||
EnterCriticalSection(&filter->cs);
|
||||
|
||||
LIST_FOR_EACH_ENTRY(event, &filter->used_events, struct event, entry)
|
||||
{
|
||||
if (!event->interrupted)
|
||||
{
|
||||
event->interrupted = TRUE;
|
||||
IReferenceClock_Unadvise(filter->clock, event->cookie);
|
||||
SetEvent(event->event);
|
||||
}
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&filter->cs);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI filter_EndOfStream(IMediaStreamFilter *iface)
|
||||
|
|
|
@ -6839,6 +6839,35 @@ static void test_mediastreamfilter_wait_until(void)
|
|||
ok(!WaitForSingleObject(cookie2.advise_time_called_event, 2000), "Expected AdviseTime to be called.\n");
|
||||
ok(WaitForSingleObject(thread2, 100) == WAIT_TIMEOUT, "WaitUntil returned prematurely.\n");
|
||||
|
||||
hr = IMediaStreamFilter_Flush(filter, FALSE);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
ok(cookie1.unadvise_called, "Expected Unadvise to be called.\n");
|
||||
ok(cookie2.unadvise_called, "Expected Unadvise to be called.\n");
|
||||
|
||||
ok(!WaitForSingleObject(thread1, 2000), "Wait timed out.\n");
|
||||
CloseHandle(thread1);
|
||||
ok(!WaitForSingleObject(thread2, 2000), "Wait timed out.\n");
|
||||
CloseHandle(thread2);
|
||||
|
||||
clock.advise_time_cookie = &cookie1;
|
||||
|
||||
params1.filter = filter;
|
||||
params1.time = 23456789;
|
||||
params1.expected_hr = S_FALSE;
|
||||
thread1 = CreateThread(NULL, 0, mediastreamfilter_wait_until, ¶ms1, 0, NULL);
|
||||
ok(!WaitForSingleObject(cookie1.advise_time_called_event, 2000), "Expected AdviseTime to be called.\n");
|
||||
ok(WaitForSingleObject(thread1, 100) == WAIT_TIMEOUT, "WaitUntil returned prematurely.\n");
|
||||
|
||||
clock.advise_time_cookie = &cookie2;
|
||||
|
||||
params2.filter = filter;
|
||||
params2.time = 23456789;
|
||||
params2.expected_hr = S_FALSE;
|
||||
thread2 = CreateThread(NULL, 0, mediastreamfilter_wait_until, ¶ms2, 0, NULL);
|
||||
ok(!WaitForSingleObject(cookie2.advise_time_called_event, 2000), "Expected AdviseTime to be called.\n");
|
||||
ok(WaitForSingleObject(thread2, 100) == WAIT_TIMEOUT, "WaitUntil returned prematurely.\n");
|
||||
|
||||
hr = IMediaStreamFilter_Stop(filter);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue