# HG changeset patch # User arpi_esp # Date 987535427 0 # Node ID 2bb59b7c748a77b59ed890a0f485dfa9c421fce3 # Parent 108be5ee3b1aa1fc51e399bd020e03d4dc80096b BGR modes with VfW codecs fixed - biCompression must be 0 for BGR... diff -r 108be5ee3b1a -r 2bb59b7c748a dll_init.c --- a/dll_init.c Tue Apr 17 19:05:59 2001 +0000 +++ b/dll_init.c Tue Apr 17 19:23:47 2001 +0000 @@ -102,6 +102,7 @@ int init_video_codec(){ HRESULT ret; + int yuv=0; unsigned int outfmt=sh_video->codec->outfmt[sh_video->outfmtidx]; if(verbose) printf("======= Win32 (VFW) VIDEO Codec init =======\n"); @@ -146,6 +147,7 @@ case IMGFMT_I420: case IMGFMT_IYUV: sh_video->o_bih.biBitCount=12; + yuv=1; break; /* packed format */ @@ -153,6 +155,7 @@ case IMGFMT_UYVY: case IMGFMT_YVYU: sh_video->o_bih.biBitCount=16; + yuv=1; break; /* rgb/bgr format */ @@ -189,7 +192,7 @@ sh_video->o_bih.biHeight=-sh_video->bih->biHeight; // flip image! } - if(!(sh_video->codec->outflags[sh_video->outfmtidx] & CODECS_FLAG_YUVHACK)) + if(yuv && !(sh_video->codec->outflags[sh_video->outfmtidx] & CODECS_FLAG_YUVHACK)) sh_video->o_bih.biCompression = outfmt; if(verbose) { @@ -244,7 +247,7 @@ return 0; } - if(sh_video->codec->outflags[sh_video->outfmtidx] & CODECS_FLAG_YUVHACK) + if(yuv && sh_video->codec->outflags[sh_video->outfmtidx] & CODECS_FLAG_YUVHACK) sh_video->o_bih.biCompression = outfmt; // avi_header.our_in_buffer=malloc(avi_header.video.dwSuggestedBufferSize); // FIXME!!!!