Dmitry Timoshkov : ICCompressorChoose should initialize fccType and fccHandler fields

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jan 23 05:05:16 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 2a93c2f23defc6a4aec7a7335a5a792dd808011f
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=2a93c2f23defc6a4aec7a7335a5a792dd808011f

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Jan 23 11:24:08 2006 +0100

ICCompressorChoose should initialize fccType and fccHandler fields
for the full frames case as well.

---

 dlls/avifil32/avifile_private.h |    4 ----
 dlls/msvideo/msvideo_main.c     |   12 ++++++++++--
 include/vfw.h                   |    4 ++++
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/avifil32/avifile_private.h b/dlls/avifil32/avifile_private.h
index d29c00c..4393264 100644
--- a/dlls/avifil32/avifile_private.h
+++ b/dlls/avifil32/avifile_private.h
@@ -23,10 +23,6 @@
 #define MAX_AVISTREAMS 8
 #endif
 
-#ifndef comptypeDIB
-#define comptypeDIB  mmioFOURCC('D','I','B',' ')
-#endif
-
 #ifndef DIBWIDTHBYTES
 #define WIDTHBYTES(i)     (((i+31)&(~31))/8)
 #define DIBWIDTHBYTES(bi) WIDTHBYTES((bi).biWidth * (bi).biBitCount)
diff --git a/dlls/msvideo/msvideo_main.c b/dlls/msvideo/msvideo_main.c
index 753632f..3059243 100644
--- a/dlls/msvideo/msvideo_main.c
+++ b/dlls/msvideo/msvideo_main.c
@@ -749,6 +749,7 @@ static INT_PTR CALLBACK icm_choose_compr
     {
     case WM_INITDIALOG:
     {
+        ICINFO *ic;
         WCHAR buf[128];
         struct choose_compressor *choose_comp = (struct choose_compressor *)lparam;
 
@@ -758,6 +759,11 @@ static INT_PTR CALLBACK icm_choose_compr
         LoadStringW(MSVFW32_hModule, IDS_FULLFRAMES, buf, 128);
         SendDlgItemMessageW(hdlg, IDC_COMP_LIST, CB_ADDSTRING, 0, (LPARAM)buf);
 
+        ic = HeapAlloc(GetProcessHeap(), 0, sizeof(ICINFO));
+        ic->fccType = streamtypeVIDEO;
+        ic->fccHandler = comptypeDIB;
+        SendDlgItemMessageW(hdlg, IDC_COMP_LIST, CB_SETITEMDATA, 0, (LPARAM)ic);
+
         enum_compressors(GetDlgItem(hdlg, IDC_COMP_LIST));
 
         SendDlgItemMessageW(hdlg, IDC_COMP_LIST, CB_SETCURSEL, 0, 0);
@@ -782,8 +788,10 @@ static INT_PTR CALLBACK icm_choose_compr
             {
                 struct choose_compressor *choose_comp = (struct choose_compressor *)GetWindowLongPtrW(hdlg, DWLP_USER);
 
-                choose_comp->cv.hic = ICOpen(ic->fccType, ic->fccHandler, ICMODE_COMPRESS);
-                if (choose_comp->cv.hic)
+                if (ic->fccHandler != comptypeDIB)
+                    choose_comp->cv.hic = ICOpen(ic->fccType, ic->fccHandler, ICMODE_COMPRESS);
+
+                if (ic->fccHandler == comptypeDIB || choose_comp->cv.hic)
                 {
                     choose_comp->cv.fccType = ic->fccType;
                     choose_comp->cv.fccHandler = ic->fccHandler;
diff --git a/include/vfw.h b/include/vfw.h
index 760de96..6338fd7 100644
--- a/include/vfw.h
+++ b/include/vfw.h
@@ -143,6 +143,10 @@ DECLARE_HANDLE(HIC);
 #define	ICM_COMPRESS_FRAMES_INFO	(ICM_USER+70)
 #define	ICM_SET_STATUS_PROC		(ICM_USER+72)
 
+#ifndef comptypeDIB
+#define comptypeDIB  mmioFOURCC('D','I','B',' ')
+#endif
+
 /* structs */
 
 /* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway




More information about the wine-cvs mailing list