Jörg Höhle : Perform case-insensitive FOURCC comparison of built-in video codecs.

Alexandre Julliard julliard at winehq.org
Wed Apr 8 10:05:32 CDT 2009


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

Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date:   Wed Apr  1 21:06:52 2009 +0200

Perform case-insensitive FOURCC comparison of built-in video codecs.

---

 dlls/iccvid/iccvid.c       |    3 ++-
 dlls/msrle32/msrle32.c     |    4 +++-
 dlls/msvfw32/tests/msvfw.c |    4 ++--
 dlls/msvidc32/msvideo1.c   |    5 +++--
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dlls/iccvid/iccvid.c b/dlls/iccvid/iccvid.c
index 77328ea..1a1b33e 100644
--- a/dlls/iccvid/iccvid.c
+++ b/dlls/iccvid/iccvid.c
@@ -57,6 +57,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(iccvid);
 static HINSTANCE ICCVID_hModule;
 
 #define ICCVID_MAGIC mmioFOURCC('c', 'v', 'i', 'd')
+#define compare_fourcc(fcc1, fcc2) (((fcc1)^(fcc2))&~0x20202020)
 
 #define DBUG    0
 #define MAX_STRIPS 32
@@ -975,7 +976,7 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
 
         TRACE("Opened\n");
 
-        if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
+        if (icinfo && compare_fourcc(icinfo->fccType, ICTYPE_VIDEO)) return 0;
 
         info = heap_alloc( sizeof (ICCVID_Info) );
         if( info )
diff --git a/dlls/msrle32/msrle32.c b/dlls/msrle32/msrle32.c
index b0354b9..e157027 100644
--- a/dlls/msrle32/msrle32.c
+++ b/dlls/msrle32/msrle32.c
@@ -34,6 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msrle32);
 
 static HINSTANCE MSRLE32_hModule = 0;
 
+#define compare_fourcc(fcc1, fcc2) (((fcc1)^(fcc2))&~0x20202020)
+
 #define ABS(a)                ((a) < 0 ? -(a) : (a))
 #define SQR(a)                ((a) * (a))
 
@@ -1114,7 +1116,7 @@ static CodecInfo* Open(LPICOPEN icinfo)
     return (LPVOID)0xFFFF0000;
   }
 
-  if (icinfo->fccType != ICTYPE_VIDEO) return NULL;
+  if (compare_fourcc(icinfo->fccType, ICTYPE_VIDEO)) return NULL;
 
   TRACE("(%p = {%u,0x%08X(%4.4s),0x%08X(%4.4s),0x%X,0x%X,...})\n", icinfo,
 	icinfo->dwSize,	icinfo->fccType, (char*)&icinfo->fccType,
diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c
index 537c230..1082486 100644
--- a/dlls/msvfw32/tests/msvfw.c
+++ b/dlls/msvfw32/tests/msvfw.c
@@ -42,12 +42,12 @@ static void test_OpenCase(void)
         ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
     }
     h = ICOpen(mmioFOURCC('V','I','D','C'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
-    todo_wine ok(0!=h,"ICOpen(VIDC.msvc) failed\n");
+    ok(0!=h,"ICOpen(VIDC.msvc) failed\n");
     if (h) {
         ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
     }
     h = ICOpen(mmioFOURCC('V','I','D','C'),mmioFOURCC('M','S','V','C'),ICMODE_DECOMPRESS);
-    todo_wine ok(0!=h,"ICOpen(VIDC.MSVC) failed\n");
+    ok(0!=h,"ICOpen(VIDC.MSVC) failed\n");
     if (h) {
         ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
     }
diff --git a/dlls/msvidc32/msvideo1.c b/dlls/msvidc32/msvideo1.c
index 9de2a2d..ab51e4c 100644
--- a/dlls/msvidc32/msvideo1.c
+++ b/dlls/msvidc32/msvideo1.c
@@ -7,7 +7,7 @@
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -50,6 +50,7 @@ static HINSTANCE MSVIDC32_hModule;
 #define CRAM_MAGIC mmioFOURCC('C', 'R', 'A', 'M')
 #define MSVC_MAGIC mmioFOURCC('M', 'S', 'V', 'C')
 #define WHAM_MAGIC mmioFOURCC('W', 'H', 'A', 'M')
+#define compare_fourcc(fcc1, fcc2) (((fcc1)^(fcc2))&~0x20202020)
 
 #define PALETTE_COUNT 256
 #define LE_16(x)  ((((const uint8_t *)(x))[1] << 8) | ((const uint8_t *)(x))[0])
@@ -502,7 +503,7 @@ LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
 
         TRACE("Opened\n");
 
-        if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
+        if (icinfo && compare_fourcc(icinfo->fccType, ICTYPE_VIDEO)) return 0;
 
         info = HeapAlloc( GetProcessHeap(), 0, sizeof (Msvideo1Context) );
         if( info )




More information about the wine-cvs mailing list