quartz: Handle NULL target format in FilterGraph::ConvertTimeFormat.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2016-01-06 23:29:42 +06:00 committed by Alexandre Julliard
parent e034c41953
commit e4dbaeebbd
2 changed files with 24 additions and 0 deletions

View File

@ -2530,6 +2530,9 @@ static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, LONGL
if (!pSourceFormat) if (!pSourceFormat)
pSourceFormat = &This->timeformatseek; pSourceFormat = &This->timeformatseek;
if (!pTargetFormat)
pTargetFormat = &This->timeformatseek;
if (IsEqualGUID(pTargetFormat, pSourceFormat)) if (IsEqualGUID(pTargetFormat, pSourceFormat))
*pTarget = Source; *pTarget = Source;
else else

View File

@ -255,6 +255,7 @@ static void test_mediacontrol(void)
{ {
HRESULT hr; HRESULT hr;
LONGLONG pos = 0xdeadbeef; LONGLONG pos = 0xdeadbeef;
GUID format = GUID_NULL;
IMediaSeeking *seeking = NULL; IMediaSeeking *seeking = NULL;
IMediaFilter *filter = NULL; IMediaFilter *filter = NULL;
IMediaControl *control = NULL; IMediaControl *control = NULL;
@ -282,6 +283,26 @@ static void test_mediacontrol(void)
return; return;
} }
format = GUID_NULL;
hr = IMediaSeeking_GetTimeFormat(seeking, &format);
ok(hr == S_OK, "GetTimeFormat failed: %08x\n", hr);
ok(IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME), "GetTimeFormat: unexpected format %s\n", wine_dbgstr_guid(&format));
pos = 0xdeadbeef;
hr = IMediaSeeking_ConvertTimeFormat(seeking, &pos, NULL, 0x123456789a, NULL);
ok(hr == S_OK, "ConvertTimeFormat failed: %08x\n", hr);
ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos);
pos = 0xdeadbeef;
hr = IMediaSeeking_ConvertTimeFormat(seeking, &pos, &TIME_FORMAT_MEDIA_TIME, 0x123456789a, NULL);
ok(hr == S_OK, "ConvertTimeFormat failed: %08x\n", hr);
ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos);
pos = 0xdeadbeef;
hr = IMediaSeeking_ConvertTimeFormat(seeking, &pos, NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
ok(hr == S_OK, "ConvertTimeFormat failed: %08x\n", hr);
ok(pos == 0x123456789a, "ConvertTimeFormat: expected 123456789a, got (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos);
hr = IMediaSeeking_GetCurrentPosition(seeking, &pos); hr = IMediaSeeking_GetCurrentPosition(seeking, &pos);
ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr); ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr);
ok(pos == 0, "Position != 0 (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos); ok(pos == 0, "Position != 0 (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos);