mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-22 21:54:10 +00:00
qcap/filewriter: Avoid casting to DWORD in an ERR message.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
10667b39aa
commit
50a06d0dc4
|
@ -68,26 +68,27 @@ static HRESULT WINAPI file_writer_sink_receive(struct strmbase_sink *iface, IMed
|
||||||
struct file_writer *filter = impl_from_strmbase_pin(&iface->pin);
|
struct file_writer *filter = impl_from_strmbase_pin(&iface->pin);
|
||||||
REFERENCE_TIME start, stop;
|
REFERENCE_TIME start, stop;
|
||||||
LARGE_INTEGER offset;
|
LARGE_INTEGER offset;
|
||||||
|
DWORD size, ret_size;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
DWORD size;
|
|
||||||
BYTE *data;
|
BYTE *data;
|
||||||
|
|
||||||
if ((hr = IMediaSample_GetTime(sample, &start, &stop)) != S_OK)
|
if ((hr = IMediaSample_GetTime(sample, &start, &stop)) != S_OK)
|
||||||
ERR("Failed to get sample time, hr %#lx.\n", hr);
|
ERR("Failed to get sample time, hr %#lx.\n", hr);
|
||||||
|
size = stop - start;
|
||||||
|
|
||||||
if ((hr = IMediaSample_GetPointer(sample, &data)) != S_OK)
|
if ((hr = IMediaSample_GetPointer(sample, &data)) != S_OK)
|
||||||
ERR("Failed to get sample pointer, hr %#lx.\n", hr);
|
ERR("Failed to get sample pointer, hr %#lx.\n", hr);
|
||||||
|
|
||||||
offset.QuadPart = start;
|
offset.QuadPart = start;
|
||||||
if (!SetFilePointerEx(filter->file, offset, NULL, FILE_BEGIN)
|
if (!SetFilePointerEx(filter->file, offset, NULL, FILE_BEGIN)
|
||||||
|| !WriteFile(filter->file, data, stop - start, &size, NULL))
|
|| !WriteFile(filter->file, data, size, &ret_size, NULL))
|
||||||
{
|
{
|
||||||
ERR("Failed to write file, error %lu.\n", GetLastError());
|
ERR("Failed to write file, error %lu.\n", GetLastError());
|
||||||
return HRESULT_FROM_WIN32(hr);
|
return HRESULT_FROM_WIN32(hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size != stop - start)
|
if (ret_size != size)
|
||||||
ERR("Short write, %lu/%lu.\n", size, (DWORD)(stop - start));
|
ERR("Short write, %lu/%lu.\n", ret_size, size);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue