From 0a2bf907337bf787feac68b0da8345149a734c6a Mon Sep 17 00:00:00 2001 From: Gijs Vermeulen Date: Thu, 6 Aug 2020 20:32:31 +0200 Subject: [PATCH] amstream: Return S_FALSE when IMediaSeeking::GetDuration() fails in IAMMultiMediaStream::GetDuration(). Signed-off-by: Gijs Vermeulen Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/amstream/multimedia.c | 6 +++++- dlls/amstream/tests/amstream.c | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index 5425ef42a37..82ef4822344 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -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) diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 6a72f3ed891..a25ae42a314 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -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);