Gijs Vermeulen : amstream: Accept only MEDIASUBTYPE_RGB8 in check_media_type().

Alexandre Julliard julliard at winehq.org
Wed Jul 1 15:22:48 CDT 2020


Module: wine
Branch: master
Commit: a7c515fe01c4902a3e7c6b60608a54b77e252b47
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a7c515fe01c4902a3e7c6b60608a54b77e252b47

Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date:   Tue Jun 30 19:57:17 2020 -0500

amstream: Accept only MEDIASUBTYPE_RGB8 in check_media_type().

Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/amstream/ddrawstream.c    | 21 +++++----------------
 dlls/amstream/tests/amstream.c |  5 ++---
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c
index 9fcb6d37ce..5530603f7a 100644
--- a/dlls/amstream/ddrawstream.c
+++ b/dlls/amstream/ddrawstream.c
@@ -632,23 +632,12 @@ static HRESULT WINAPI ddraw_sink_Connect(IPin *iface, IPin *peer, const AM_MEDIA
     return E_UNEXPECTED;
 }
 
-static BOOL check_media_type(const AM_MEDIA_TYPE *media_type)
+static BOOL check_media_type(const AM_MEDIA_TYPE *mt)
 {
-    if (IsEqualGUID(&media_type->majortype, &MEDIATYPE_Video)
-            && IsEqualGUID(&media_type->formattype, &FORMAT_VideoInfo))
-    {
-        if (IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB1) ||
-            IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB4) ||
-            IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB8)  ||
-            IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB565) ||
-            IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB555) ||
-            IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB24) ||
-            IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB32))
-        {
-            TRACE("Video sub-type %s matches\n", debugstr_guid(&media_type->subtype));
-            return TRUE;
-        }
-    }
+    if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Video)
+            && IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB8)
+            && IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo))
+        return TRUE;
 
     return FALSE;
 }
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c
index 1fa1f2432c..bbad585d48 100644
--- a/dlls/amstream/tests/amstream.c
+++ b/dlls/amstream/tests/amstream.c
@@ -1970,9 +1970,8 @@ static void test_media_types(void)
     {
         pmt->subtype = *rejected_subtypes[i];
         hr = IPin_QueryAccept(pin, pmt);
-        todo_wine_if (i < 6)
-            ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n",
-                hr, wine_dbgstr_guid(rejected_subtypes[i]));
+        ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n",
+            hr, wine_dbgstr_guid(rejected_subtypes[i]));
     }
 
     CoTaskMemFree(pmt);




More information about the wine-cvs mailing list