amstream: Return S_FALSE when IMediaSeeking::GetDuration() fails in IAMMultiMediaStream::GetDuration().

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-08-06 20:32:31 +02:00 committed by Alexandre Julliard
parent bdf8600338
commit 0a2bf90733
2 changed files with 8 additions and 4 deletions

View File

@ -181,7 +181,11 @@ static HRESULT WINAPI multimedia_stream_GetDuration(IAMMultiMediaStream *iface,
if (!mmstream->media_seeking)
return E_NOINTERFACE;
return IMediaSeeking_GetDuration(mmstream->media_seeking, duration);
if (IMediaSeeking_GetDuration(mmstream->media_seeking, duration) != S_OK)
return S_FALSE;
return S_OK;
}
static HRESULT WINAPI multimedia_stream_Seek(IAMMultiMediaStream *iface, STREAM_TIME seek_time)

View File

@ -414,7 +414,7 @@ static void test_mmstream_get_duration(const WCHAR *test_avi_path)
duration = 0xdeadbeefdeadbeefULL;
hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(duration == 0, "Got duration %s.\n", wine_dbgstr_longlong(duration));
ref = IAMMultiMediaStream_Release(mmstream);
@ -427,7 +427,7 @@ static void test_mmstream_get_duration(const WCHAR *test_avi_path)
duration = 0xdeadbeefdeadbeefULL;
hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(duration == 0, "Got duration %s.\n", wine_dbgstr_longlong(duration));
ref = IAMMultiMediaStream_Release(mmstream);
@ -442,7 +442,7 @@ static void test_mmstream_get_duration(const WCHAR *test_avi_path)
duration = 0xdeadbeefdeadbeefULL;
hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(duration == 0, "Got duration %s.\n", wine_dbgstr_longlong(duration));
ref = IAMMultiMediaStream_Release(mmstream);