Commit d293200f authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

quartz: Reset the event if the queue was empty in IMediaEvent::GetEvent().

parent aab10e6c
...@@ -4744,6 +4744,7 @@ static HRESULT WINAPI MediaEvent_GetEvent(IMediaEventEx *iface, LONG *code, ...@@ -4744,6 +4744,7 @@ static HRESULT WINAPI MediaEvent_GetEvent(IMediaEventEx *iface, LONG *code,
if (!(entry = list_head(&graph->media_events))) if (!(entry = list_head(&graph->media_events)))
{ {
ResetEvent(graph->media_event_handle);
LeaveCriticalSection(&graph->cs); LeaveCriticalSection(&graph->cs);
return E_ABORT; return E_ABORT;
} }
...@@ -4754,9 +4755,6 @@ static HRESULT WINAPI MediaEvent_GetEvent(IMediaEventEx *iface, LONG *code, ...@@ -4754,9 +4755,6 @@ static HRESULT WINAPI MediaEvent_GetEvent(IMediaEventEx *iface, LONG *code,
*param2 = event->param2; *param2 = event->param2;
free(event); free(event);
if (list_empty(&graph->media_events))
ResetEvent(graph->media_event_handle);
LeaveCriticalSection(&graph->cs); LeaveCriticalSection(&graph->cs);
return S_OK; return S_OK;
} }
......
...@@ -5260,7 +5260,7 @@ static void test_set_notify_flags(void) ...@@ -5260,7 +5260,7 @@ static void test_set_notify_flags(void)
hr = IMediaEventEx_GetEvent(media_event, &code, &param1, &param2, 50); hr = IMediaEventEx_GetEvent(media_event, &code, &param1, &param2, 50);
ok(hr == E_ABORT, "Got hr %#x.\n", hr); ok(hr == E_ABORT, "Got hr %#x.\n", hr);
todo_wine ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n"); ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n");
hr = IMediaEventEx_SetNotifyFlags(media_event, 0); hr = IMediaEventEx_SetNotifyFlags(media_event, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
...@@ -5474,7 +5474,7 @@ static void test_events(void) ...@@ -5474,7 +5474,7 @@ static void test_events(void)
hr = IMediaEventEx_GetEvent(media_event, &code, &param1, &param2, 50); hr = IMediaEventEx_GetEvent(media_event, &code, &param1, &param2, 50);
ok(hr == E_ABORT, "Got hr %#x.\n", hr); ok(hr == E_ABORT, "Got hr %#x.\n", hr);
todo_wine ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n"); ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n");
hr = IMediaControl_Stop(media_control); hr = IMediaControl_Stop(media_control);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
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