quartz/memallocator: Forbid setting the start media time without setting the end time.

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-06-24 20:05:16 -05:00 committed by Alexandre Julliard
parent da6afd5cfd
commit 44318feeb6
2 changed files with 11 additions and 12 deletions

View File

@ -734,21 +734,20 @@ static HRESULT WINAPI StdMediaSample2_GetMediaTime(IMediaSample2 * iface, LONGLO
return S_OK;
}
static HRESULT WINAPI StdMediaSample2_SetMediaTime(IMediaSample2 * iface, LONGLONG * pStart, LONGLONG * pEnd)
static HRESULT WINAPI StdMediaSample2_SetMediaTime(IMediaSample2 *iface, LONGLONG *start, LONGLONG *end)
{
StdMediaSample2 *This = impl_from_IMediaSample2(iface);
StdMediaSample2 *sample = impl_from_IMediaSample2(iface);
TRACE("(%p)->(%p, %p)\n", iface, pStart, pEnd);
TRACE("sample %p, start %p, end %p.\n", iface, start, end);
if (pStart)
This->tMediaStart = *pStart;
if (start)
{
if (!end) return E_POINTER;
sample->tMediaStart = *start;
sample->tMediaEnd = *end;
}
else
This->tMediaStart = INVALID_MEDIA_TIME;
if (pEnd)
This->tMediaEnd = *pEnd;
else
This->tMediaEnd = 0;
sample->tMediaStart = INVALID_MEDIA_TIME;
return S_OK;
}

View File

@ -379,7 +379,7 @@ static void test_media_time(void)
{
start = 0x123;
hr = IMediaSample_SetMediaTime(sample, &start, NULL);
todo_wine ok(hr == E_POINTER, "Got hr %#x.\n", hr);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
}
end = 0x321;