[MCIAVI] Handle avi files with non standard video stream names.

Christian Costa titan.costa at wanadoo.fr
Mon Mar 15 17:05:43 CST 2004


Hi,

See comment for details.

Changelog :
Handle avi files with non standard video stream names.

Christian Costa   titan.costa at wanadoo.fr
-------------- next part --------------
Index: mmoutput.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mciavi/mmoutput.c,v
retrieving revision 1.13
diff -u -r1.13 mmoutput.c
--- mmoutput.c	1 Mar 2004 23:38:25 -0000	1.13
+++ mmoutput.c	15 Mar 2004 21:56:12 -0000
@@ -166,6 +166,7 @@
 {
     const BYTE *p;
     DWORD stream_n;
+    DWORD twocc;
 
     if (mmck->ckid == ckidAVIPADDING) return TRUE;
 
@@ -183,7 +184,18 @@
 
     TRACE("ckid %4.4s (stream #%ld)\n", (LPSTR)&mmck->ckid, stream_n);
 
-    switch (TWOCCFromFOURCC(mmck->ckid)) {
+    /* Some (rare?) AVI files have video streams name XXYY where XX = stream number and YY = TWOCC
+     * of the last 2 characters of the biCompression member of the BITMAPINFOHEADER structure.
+     * Ex: fccHandler = IV32 & biCompression = IV32 => stream name = XX32
+     *     fccHandler = MSVC & biCompression = CRAM => stream name = XXAM
+     * Another possibility is that these TWOCC are simply ignored.
+     * Default to cktypeDIBcompressed when this case happens.
+     */
+    twocc = TWOCCFromFOURCC(mmck->ckid);
+    if (twocc == TWOCCFromFOURCC(wma->inbih->biCompression))
+	twocc = cktypeDIBcompressed;
+    
+    switch (twocc) {
     case cktypeDIBbits:
     case cktypeDIBcompressed:
     case cktypePALchange:


More information about the wine-patches mailing list