Zebediah Figura : winegstreamer: Always set the initial video type for the WMF reader to WG_VIDEO_FORMAT_BGR.

Alexandre Julliard julliard at winehq.org
Thu Dec 30 16:11:34 CST 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Dec 29 22:04:35 2021 -0600

winegstreamer: Always set the initial video type for the WMF reader to WG_VIDEO_FORMAT_BGR.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52273
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/wm_reader.c | 8 +++++---
 dlls/wmvcore/tests/wmvcore.c   | 2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 3a1f1684fdc..693e9adfc19 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -1503,9 +1503,11 @@ static HRESULT init_stream(struct wm_reader *reader, QWORD file_size)
         {
             /* Call of Juarez: Bound in Blood breaks if I420 is enumerated.
              * Some native decoders output I420, but the msmpeg4v3 decoder
-             * never does. */
-            if (stream->format.u.video.format == WG_VIDEO_FORMAT_I420)
-                stream->format.u.video.format = WG_VIDEO_FORMAT_YV12;
+             * never does.
+             *
+             * Shadowgrounds provides wmv3 video and assumes that the initial
+             * video type will be BGR. */
+            stream->format.u.video.format = WG_VIDEO_FORMAT_BGR;
         }
         wg_parser_stream_enable(stream->wg_stream, &stream->format);
     }
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index 66ad89a185e..1b9cffaee1d 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -2388,6 +2388,8 @@ static void test_async_reader_types(void)
         else
         {
             ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype));
+            /* Shadowgrounds assumes that the initial video type will be RGB24. */
+            ok(IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB24), "Got subtype %s.\n", debugstr_guid(&mt->subtype));
             got_video = true;
             check_video_type(mt);
         }




More information about the wine-cvs mailing list