From 77c3fa8ab47a98ad0a25823470c0264e346cea06 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Tue, 31 Aug 2021 15:25:48 -0400 Subject: [PATCH] Moved Vfw compressor choose window popup to be after file overwrite warning popup for Qt GUI. --- src/drivers/Qt/AviRecord.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/drivers/Qt/AviRecord.cpp b/src/drivers/Qt/AviRecord.cpp index 94e4c758..b8a0b9d4 100644 --- a/src/drivers/Qt/AviRecord.cpp +++ b/src/drivers/Qt/AviRecord.cpp @@ -443,6 +443,7 @@ static int init( int width, int height ) // Allocate a buffer and get lpOutput to point to it. h = GlobalAlloc(GHND, dwCompressBufferSize); outBuf = (LPVOID)GlobalLock(h); + memset( outBuf, 0, dwCompressBufferSize); //dwQuality = ICGetDefaultQuality( cmpvars.hic ); if ( qualitySupported ) @@ -456,7 +457,12 @@ static int init( int width, int height ) //printf("Quality Setting: %i\n", dwQuality ); - ICCompressBegin( cmpvars.hic, &bmapIn, bmapOut ); + if ( ICCompressBegin( cmpvars.hic, &bmapIn, bmapOut ) != ICERR_OK ) + { + printf("Error: ICCompressBegin\n"); + icErrCount = 9999; + return -1; + } frameNum = 0; flagsOut = 0; @@ -531,16 +537,6 @@ int aviRecordOpenFile( const char *filepath ) double fps; char fileName[1024]; -#ifdef WIN32 - if ( videoFormat == AVI_VFW ) - { - if ( VFW::chooseConfig( nes_shm->video.ncol, nes_shm->video.nrow ) ) - { - return -1; - } - } -#endif - if ( filepath != NULL ) { strcpy( fileName, filepath ); @@ -599,6 +595,16 @@ int aviRecordOpenFile( const char *filepath ) } } +#ifdef WIN32 + if ( videoFormat == AVI_VFW ) + { + if ( VFW::chooseConfig( nes_shm->video.ncol, nes_shm->video.nrow ) ) + { + return -1; + } + } +#endif + if ( gwavi != NULL ) { delete gwavi; gwavi = NULL;