From: R��mi Bernon rbernon@codeweavers.com
And unconditionally assign new context for ASYNC_OP_START. --- dlls/winegstreamer/wm_asyncreader.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index f3e2209881a..a14beb37951 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -30,7 +30,7 @@ struct async_op ASYNC_OP_STOP, ASYNC_OP_CLOSE, } type; - void *new_context; + void *data; struct list entry; };
@@ -191,13 +191,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->new_context) - reader->context = op->new_context; hr = list_empty(&reader->async_ops) ? S_OK : E_ABORT; switch (op->type) { case ASYNC_OP_START: { + reader->context = op->data; LeaveCriticalSection(&reader->callback_cs); IWMReaderCallback_OnStatus(reader->callback, WMT_STARTED, hr, WMT_TYPE_DWORD, (BYTE *)&zero, reader->context); @@ -291,14 +290,14 @@ error: return hr; }
-static HRESULT async_reader_queue_op(struct async_reader *reader, enum async_op_type type, void *context) +static HRESULT async_reader_queue_op(struct async_reader *reader, enum async_op_type type, void *data) { struct async_op *op;
if (!(op = calloc(1, sizeof(*op)))) return E_OUTOFMEMORY; op->type = type; - op->new_context = context; + op->data = data;
EnterCriticalSection(&reader->callback_cs); list_add_tail(&reader->async_ops, &op->entry);