Modified AVI RIFF viewer code to allow for multiple instances of the window.

This commit is contained in:
mjbudd77 2021-10-03 10:16:30 -04:00
parent c799d3f11e
commit a290718962
1 changed files with 2 additions and 5 deletions

View File

@ -37,15 +37,14 @@
#include "Qt/ConsoleUtilities.h"
static bool showSizeHex = true;
static AviRiffViewerDialog *win = NULL;
//----------------------------------------------------------------------------
static int riffWalkCallback( int type, long long int fpos, const char *fourcc, size_t size, void *userData )
{
int ret = 0;
if ( win )
if ( userData )
{
ret = win->riffWalkCallback( type, fpos, fourcc, size );
ret = static_cast <AviRiffViewerDialog*>(userData)->riffWalkCallback( type, fpos, fourcc, size );
}
return ret;
}
@ -61,7 +60,6 @@ AviRiffViewerDialog::AviRiffViewerDialog(QWidget *parent)
QPushButton *closeButton;
QTreeWidgetItem *item;
win = this;
avi = NULL;
lastChunk = NULL;
memset( strhType, 0, sizeof(strhType) );
@ -121,7 +119,6 @@ AviRiffViewerDialog::~AviRiffViewerDialog(void)
{
delete avi; avi = NULL;
}
win = NULL;
}
//----------------------------------------------------------------------------
void AviRiffViewerDialog::closeEvent(QCloseEvent *event)