From 09aef50a3909802b6c8dc7e4d92aaabb352082e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 9 Sep 2022 01:02:45 +0200 Subject: [PATCH] winegstreamer: Unconditionally assign new context for ASYNC_OP_START. --- dlls/winegstreamer/wm_asyncreader.c | 3 +-- dlls/wmvcore/tests/wmvcore.c | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index c280828b616..493075859ad 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -199,13 +199,12 @@ static DWORD WINAPI async_reader_callback_thread(void *arg) struct async_op *op = LIST_ENTRY(entry, struct async_op, entry); list_remove(&op->entry); - if (op->u.start.context) - reader->context = op->u.start.context; hr = list_empty(&reader->async_ops) ? S_OK : E_ABORT; switch (op->type) { case ASYNC_OP_START: { + reader->context = op->u.start.context; LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STARTED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 6883144df6e..06e1852c8c0 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1867,7 +1867,6 @@ static HRESULT WINAPI callback_OnStatus(IWMReaderCallback *iface, WMT_STATUS sta callback->callback_tid = GetCurrentThreadId(); ok(type == WMT_TYPE_DWORD, "Got type %#x.\n", type); ok(!*(DWORD *)value, "Got value %#lx.\n", *(DWORD *)value); - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); ret = WaitForSingleObject(callback->expect_started, 100); ok(!ret, "Wait timed out.\n"); @@ -1881,7 +1880,6 @@ static HRESULT WINAPI callback_OnStatus(IWMReaderCallback *iface, WMT_STATUS sta ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n"); ok(type == WMT_TYPE_DWORD, "Got type %#x.\n", type); ok(!*(DWORD *)value, "Got value %#lx.\n", *(DWORD *)value); - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); ret = WaitForSingleObject(callback->expect_stopped, 100); ok(!ret, "Wait timed out.\n"); @@ -1891,7 +1889,6 @@ static HRESULT WINAPI callback_OnStatus(IWMReaderCallback *iface, WMT_STATUS sta case WMT_CLOSED: ok(type == WMT_TYPE_DWORD, "Got type %#x.\n", type); ok(!*(DWORD *)value, "Got value %#lx.\n", *(DWORD *)value); - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); ++callback->closed_count; break; @@ -1900,7 +1897,6 @@ static HRESULT WINAPI callback_OnStatus(IWMReaderCallback *iface, WMT_STATUS sta ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n"); ok(type == WMT_TYPE_DWORD, "Got type %#x.\n", type); ok(!*(DWORD *)value, "Got value %#lx.\n", *(DWORD *)value); - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); ++callback->end_of_streaming_count; break; @@ -1909,7 +1905,6 @@ static HRESULT WINAPI callback_OnStatus(IWMReaderCallback *iface, WMT_STATUS sta ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n"); ok(type == WMT_TYPE_DWORD, "Got type %#x.\n", type); ok(!*(DWORD *)value, "Got value %#lx.\n", *(DWORD *)value); - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); if (callback->all_streams_off) ok(callback->sample_count == 0, "Got %u samples.\n", callback->sample_count); @@ -2014,7 +2009,6 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output, ok(callback->output_tid[1 - output] != GetCurrentThreadId(), "got wrong thread\n"); } - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); check_async_sample(callback, sample); @@ -2114,7 +2108,6 @@ static HRESULT WINAPI callback_advanced_OnTime(IWMReaderCallbackAdvanced *iface, ok(callback->callback_tid == GetCurrentThreadId(), "got wrong thread\n"); ok(time == callback->expect_ontime, "Got time %I64u.\n", time); - todo_wine_if(!callback->expect_context) ok(context == (void *)callback->expect_context, "Got unexpected context %p.\n", context); SetEvent(callback->ontime_event); return S_OK;