Nikolay Sivov : mfplat: Use current stream position when async request is made.
Alexandre Julliard
julliard at winehq.org
Wed Mar 27 17:27:36 CDT 2019
Module: wine
Branch: master
Commit: 17613e0a03ec74f9f4853b92b77d692762474c88
URL: https://source.winehq.org/git/wine.git/?a=commit;h=17613e0a03ec74f9f4853b92b77d692762474c88
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Mar 27 10:13:10 2019 +0300
mfplat: Use current stream position when async request is made.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mfplat/main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 83eaee9..c6cf471 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -2013,6 +2013,7 @@ struct async_stream_op
const BYTE *src;
BYTE *dest;
} u;
+ QWORD position;
ULONG requested_length;
ULONG actual_length;
IMFAsyncResult *caller;
@@ -2087,6 +2088,7 @@ static HRESULT bytestream_create_io_request(struct bytestream *stream, enum asyn
op->IUnknown_iface.lpVtbl = &async_stream_op_vtbl;
op->refcount = 1;
op->u.src = data;
+ op->position = stream->position;
op->requested_length = size;
op->type = type;
if (FAILED(hr = MFCreateAsyncResult((IUnknown *)&stream->IMFByteStream_iface, callback, state, &op->caller)))
@@ -2645,7 +2647,7 @@ static HRESULT WINAPI bytestream_stream_read_callback_Invoke(IMFAsyncCallback *i
op = impl_async_stream_op_from_IUnknown(object);
- position.QuadPart = stream->position;
+ position.QuadPart = op->position;
if (SUCCEEDED(hr = IStream_Seek(stream->stream, position, STREAM_SEEK_SET, NULL)))
{
if (SUCCEEDED(hr = IStream_Read(stream->stream, op->u.dest, op->requested_length, &op->actual_length)))
@@ -2676,7 +2678,7 @@ static HRESULT WINAPI bytestream_stream_write_callback_Invoke(IMFAsyncCallback *
op = impl_async_stream_op_from_IUnknown(object);
- position.QuadPart = stream->position;
+ position.QuadPart = op->position;
if (SUCCEEDED(hr = IStream_Seek(stream->stream, position, STREAM_SEEK_SET, NULL)))
{
if (SUCCEEDED(hr = IStream_Write(stream->stream, op->u.src, op->requested_length, &op->actual_length)))
More information about the wine-cvs
mailing list