quartz/memallocator: Set the sample end time only if the start time is valid.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b9073b1e94
commit
646d3a103e
|
@ -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;
|
||||
sample->props.tStart = *start;
|
||||
sample->props.dwSampleFlags |= AM_SAMPLE_TIMEVALID;
|
||||
|
||||
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_TIMEVALID;
|
||||
|
||||
if (pEnd)
|
||||
{
|
||||
This->props.tStop = *pEnd;
|
||||
This->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;
|
||||
|
|
Loading…
Reference in New Issue