Commit 3d24e7de authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

parent f784cabd
......@@ -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;
}
......
......@@ -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);
......
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