diff --git a/src/drivers/Qt/AviRecord.cpp b/src/drivers/Qt/AviRecord.cpp index 846a5a93..af0b44a9 100644 --- a/src/drivers/Qt/AviRecord.cpp +++ b/src/drivers/Qt/AviRecord.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef WIN32 #include @@ -326,17 +327,33 @@ static LPVOID outBuf = NULL; static int chooseConfig(int width, int height) { bool ret; + char fccHandler[8]; + std::string fccHandlerString; if ( cmpSet ) { ICCompressorFree( &cmpvars ); cmpSet = false; } + memset( fccHandler, 0, sizeof(fccHandler)); memset( &cmpvars, 0, sizeof(COMPVARS)); cmpvars.cbSize = sizeof(COMPVARS); + + g_config->getOption("SDL.AviVfwFccHandler", &fccHandlerString); + + if ( fccHandlerString.size() > 0 ) + { + strcpy( fccHandler, fccHandlerString.c_str() ); + memcpy( &cmpvars.fccHandler, fccHandler, 4 ); + cmpvars.dwFlags = ICMF_COMPVARS_VALID; + } + ret = ICCompressorChoose( HWND(consoleWindow->winId()), ICMF_CHOOSE_ALLCOMPRESSORS, 0, NULL, &cmpvars, 0); + memcpy( fccHandler, &cmpvars.fccHandler, 4 ); + fccHandler[4] = 0; + printf("FCC:%08X %c%c%c%c \n", cmpvars.fccHandler, (cmpvars.fccHandler & 0x000000FF) , (cmpvars.fccHandler & 0x0000FF00) >> 8, @@ -345,6 +362,7 @@ static int chooseConfig(int width, int height) if ( ret ) { + g_config->setOption("SDL.AviVfwFccHandler", fccHandler); cmpSet = true; } return (cmpSet == false) ? -1 : 0; diff --git a/src/drivers/Qt/config.cpp b/src/drivers/Qt/config.cpp index 6626026a..b1a75bce 100644 --- a/src/drivers/Qt/config.cpp +++ b/src/drivers/Qt/config.cpp @@ -603,6 +603,10 @@ InitConfig() config->addOption("SDL.AviVideoFormat", AVI_RGB24); #endif +#ifdef WIN32 + config->addOption("SDL.AviVfwFccHandler", ""); +#endif + // Cheat Options config->addOption("SDL.CheatsDisabled", 0); config->addOption("SDL.CheatsDisableAutoLS", 0);