Commit 646d3a10 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/memallocator: Set the sample end time only if the start time is valid.

parent b9073b1e
......@@ -560,27 +560,27 @@ static HRESULT WINAPI StdMediaSample2_GetTime(IMediaSample2 * iface, REFERENCE_T
return hr;
}
static HRESULT WINAPI StdMediaSample2_SetTime(IMediaSample2 * iface, REFERENCE_TIME * pStart, REFERENCE_TIME * pEnd)
static HRESULT WINAPI StdMediaSample2_SetTime(IMediaSample2 *iface, REFERENCE_TIME *start, REFERENCE_TIME *end)
{
StdMediaSample2 *This = impl_from_IMediaSample2(iface);
StdMediaSample2 *sample = impl_from_IMediaSample2(iface);
TRACE("(%p)->(%p, %p)\n", iface, pStart, pEnd);
TRACE("iface %p, start %p, end %p.\n", iface, start, end);
if (pStart)
if (start)
{
This->props.tStart = *pStart;
This->props.dwSampleFlags |= AM_SAMPLE_TIMEVALID;
}
else
This->props.dwSampleFlags &= ~AM_SAMPLE_TIMEVALID;
sample->props.tStart = *start;
sample->props.dwSampleFlags |= AM_SAMPLE_TIMEVALID;
if (pEnd)
{
This->props.tStop = *pEnd;
This->props.dwSampleFlags |= AM_SAMPLE_STOPVALID;
if (end)
{
sample->props.tStop = *end;
sample->props.dwSampleFlags |= AM_SAMPLE_STOPVALID;
}
else
sample->props.dwSampleFlags &= ~AM_SAMPLE_STOPVALID;
}
else
This->props.dwSampleFlags &= ~AM_SAMPLE_STOPVALID;
sample->props.dwSampleFlags &= ~(AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID);
return S_OK;
}
......
......@@ -245,7 +245,7 @@ static void test_sample_time(void)
hr = IMediaSample2_GetProperties(sample2, sizeof(props), (BYTE *)&props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
ok(!props.dwSampleFlags, "Got flags %#x.\n", props.dwSampleFlags);
start = 0x123;
end = 0x321;
......
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