diff --git a/source/app/InputStream.cpp b/source/app/InputStream.cpp index 5b84636..92d0553 100755 --- a/source/app/InputStream.cpp +++ b/source/app/InputStream.cpp @@ -194,6 +194,7 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for if( !avStatus ) { + m_pFile = NULL; m_pFile = fopen( m_cFilename.toLocal8Bit().data(), "rb" ); if( m_pFile == NULL ) { @@ -250,7 +251,7 @@ Void InputStream::close() if( m_pInputBuffer ) freeMem1D( m_pInputBuffer ); - m_iStatus = 0; + m_bInit = false; } Void InputStream::readNextFrame() diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index a2e8a2d..d9716b9 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -51,7 +51,6 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : m_pCurrStream = new InputStream; - m_pCurrFrameQImage = NULL; m_pcCurrentModule = NULL; m_cWindowName = QString( " " ); @@ -63,8 +62,6 @@ SubWindowHandle::~SubWindowHandle() delete m_cViewArea; delete m_cScrollArea; delete m_pCurrStream; - if( m_pCurrFrameQImage ) - delete m_pCurrFrameQImage; if( m_pcCurrentModule ) { m_pcCurrentModule->m_pcAction->setChecked( false ); @@ -93,9 +90,6 @@ Bool SubWindowHandle::loadFile( const QString &fileName ) return false; } - m_pCurrFrameQImage = new QImage( m_pCurrStream->getCurrFrame()->getQImageBuffer(), m_pCurrStream->getWidth(), m_pCurrStream->getHeight(), - QImage::Format_RGB888 ); - m_cViewArea->setInputStream( m_pCurrStream ); QApplication::restoreOverrideCursor(); @@ -167,7 +161,9 @@ Bool SubWindowHandle::save() return false; QApplication::setOverrideCursor( Qt::WaitCursor ); - if( m_pCurrFrameQImage->save( fileName ) ) + m_pCurrStream->getCurrFrame()->FrametoRGB8(); + QImage qimg = QImage( m_pCurrStream->getCurrFrame()->getQImageBuffer(), m_pCurrStream->getCurrFrame()->getWidth(), m_pCurrStream->getCurrFrame()->getHeight(), QImage::Format_RGB888 ); + if( qimg.save( fileName ) ) { QApplication::restoreOverrideCursor(); QMessageBox::warning( this, tr( "plaYUVer" ), tr( "Cannot save file %1" ).arg( fileName ) ); diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index 0d58adf..e13b3fa 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -53,7 +53,6 @@ private: PlaYUVerModuleIf* m_pcCurrentModule; InputStream* m_pCurrStream; - QImage* m_pCurrFrameQImage; QString m_cWindowName; QString m_cCurrFileName;