Rémi Bernon : mf: Return MF_E_NO_MORE_TYPE from AudioRenderer GetMediaTypeByIndex.

Alexandre Julliard julliard at winehq.org
Tue Aug 2 14:53:35 CDT 2022


Module: wine
Branch: master
Commit: 180572129fb9ad5ca736ac1ba5d78094dc2c68db
URL:    https://gitlab.winehq.org/wine/wine/-/commit/180572129fb9ad5ca736ac1ba5d78094dc2c68db

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Jun 29 17:34:29 2022 +0200

mf: Return MF_E_NO_MORE_TYPE from AudioRenderer GetMediaTypeByIndex.

---

 dlls/mf/sar.c      | 9 ++++-----
 dlls/mf/tests/mf.c | 1 -
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c
index 5504cc17472..2aabb1fe10f 100644
--- a/dlls/mf/sar.c
+++ b/dlls/mf/sar.c
@@ -1531,12 +1531,11 @@ static HRESULT WINAPI audio_renderer_stream_type_handler_GetMediaTypeByIndex(IMF
 
     TRACE("%p, %lu, %p.\n", iface, index, media_type);
 
-    if (index == 0)
-    {
-        *media_type = renderer->media_type;
-        IMFMediaType_AddRef(*media_type);
-    }
+    if (index > 0)
+        return MF_E_NO_MORE_TYPES;
 
+    *media_type = renderer->media_type;
+    IMFMediaType_AddRef(*media_type);
     return S_OK;
 }
 
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index c3d80c3dccc..4638edbec76 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -4636,7 +4636,6 @@ if (SUCCEEDED(hr))
     ok(!!count, "Unexpected type count %lu.\n", count);
 
     hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, count, &mediatype);
-    todo_wine
     ok(hr == MF_E_NO_MORE_TYPES, "Unexpected hr %#lx.\n", hr);
 
     hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, 0, &mediatype);




More information about the wine-cvs mailing list