quartz/filesource: Set the sample length in IAsyncReader_SyncReadAligned().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-02-25 21:39:44 -06:00 committed by Alexandre Julliard
parent f784cabd34
commit 3d24e7dea9
2 changed files with 5 additions and 3 deletions

View File

@ -1292,6 +1292,8 @@ static BOOL sync_read(HANDLE file, LONGLONG offset, LONG length, BYTE *buffer, D
ovl.u.s.Offset = (DWORD)offset;
ovl.u.s.OffsetHigh = offset >> 32;
*read_len = 0;
ret = ReadFile(file, buffer, length, NULL, &ovl);
if (ret || GetLastError() == ERROR_IO_PENDING)
ret = GetOverlappedResult(file, &ovl, read_len, TRUE);
@ -1331,6 +1333,9 @@ static HRESULT WINAPI FileAsyncReader_SyncReadAligned(IAsyncReader *iface, IMedi
hr = HRESULT_FROM_WIN32(GetLastError());
}
if (SUCCEEDED(hr))
IMediaSample_SetActualDataLength(sample, read_len);
return hr;
}

View File

@ -687,7 +687,6 @@ static void test_sync_read_aligned(IAsyncReader *reader, IMemAllocator *allocato
ok(hr == S_OK, "Got hr %#x.\n", hr);
len = IMediaSample_GetActualDataLength(sample);
todo_wine
ok(len == 512, "Got length %d.\n", len);
for (i = 0; i < 512; i++)
@ -702,7 +701,6 @@ todo_wine
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
len = IMediaSample_GetActualDataLength(sample);
todo_wine
ok(len == 88, "Got length %d.\n", len);
for (i = 0; i < 88; i++)
@ -717,7 +715,6 @@ todo_wine
ok(hr == S_OK, "Got hr %#x.\n", hr);
len = IMediaSample_GetActualDataLength(sample);
todo_wine
ok(len == 0, "Got length %d.\n", len);
IMediaSample_Release(sample);