From 61d6d95e47428546ced036dcbcefb6c4a1c44a3c Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 8 May 2014 01:54:13 +0100 Subject: [PATCH 1/2] Set stream as NULL until load a file in SubWindowHandle --- source/app/SubWindowHandle.cpp | 10 ++++++++-- source/app/plaYUVerApp.cpp | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index 1051cdf..369d4fd 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -53,7 +53,7 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : m_cScrollArea->setWidgetResizable( true ); m_pCurrStream = NULL; - m_pCurrStream = new InputStream; + //m_pCurrStream = new InputStream; m_pcCurrFrame = NULL; m_pcCurrentModule = NULL; m_pcModuleSubWindow = NULL; @@ -78,7 +78,13 @@ Bool SubWindowHandle::loadFile( const QString &fileName ) Int InputFormat = -1; if( !m_pCurrStream ) + { m_pCurrStream = new InputStream; + } +// else +// { +// m_pCurrStream->close(); +// } m_pCurrStream->getFormat( Width, Height, InputFormat, FrameRate ); @@ -189,7 +195,7 @@ Void SubWindowHandle::play() Int SubWindowHandle::playEvent() { - if( m_bIsPlaying ) + if( m_pCurrStream && m_bIsPlaying ) { m_pCurrStream->setNextFrame(); refreshFrame(); diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 4bc934f..9e38268 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -437,7 +437,7 @@ void plaYUVerApp::playEvent() Void plaYUVerApp::updateCurrFrameNum() { - if( m_pcCurrentSubWindow ) + if( m_pcCurrentSubWindow && m_pcCurrentSubWindow->getInputStream() ) { Int frame_num = m_pcCurrentSubWindow->getInputStream()->getCurrFrameNum(); m_pcFrameSlider->setValue( frame_num ); @@ -446,7 +446,7 @@ Void plaYUVerApp::updateCurrFrameNum() } Void plaYUVerApp::updateTotalFrameNum( UInt total_frame_num ) { - if( m_pcCurrentSubWindow && total_frame_num == 0 ) + if( m_pcCurrentSubWindow && m_pcCurrentSubWindow->getInputStream() && total_frame_num == 0 ) { total_frame_num = m_pcCurrentSubWindow->getInputStream()->getFrameNum(); } From 3d83d222beec2137a5c046f9f228b4dc57766eeb Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 9 May 2014 00:39:26 +0100 Subject: [PATCH 2/2] Define the initial pixel format to YUV420p --- source/app/ConfigureFormatDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/app/ConfigureFormatDialog.cpp b/source/app/ConfigureFormatDialog.cpp index f6d4585..c0fbad4 100755 --- a/source/app/ConfigureFormatDialog.cpp +++ b/source/app/ConfigureFormatDialog.cpp @@ -182,7 +182,7 @@ Int ConfigureFormatDialog::runConfigureFormatDialog( UInt& rWidth, UInt& rHeight // Set default values m_spinBoxWidth->setValue( rWidth ); m_spinBoxheight->setValue( rHeight ); - m_comboBoxPixelFormat->setCurrentIndex( rInputFormat ); + m_comboBoxPixelFormat->setCurrentIndex( rInputFormat >= 0 ? rInputFormat : 0 ); m_spinBoxFrameRate->setValue( rFrameRate ); for( Int i = 0; i < standardResolutionSizesList.size(); i++ ) {