From cfe4436ca945d70abe7cc8c01535e1c7148bd980 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 5 Jan 2015 23:38:04 +0000 Subject: [PATCH] Fix load file in order to handle format button --- app/VideoSubWindow.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index defb114..6ff9451 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -130,16 +130,7 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) Int InputFormat = -1; if( !m_pCurrStream ) - { - m_pCurrStream = new PlaYUVerStream; - } - else - { - delete m_pCurrStream; - m_pCurrStream = new PlaYUVerStream; - } - - m_pCurrStream->getFormat( Width, Height, InputFormat, FrameRate ); + m_pCurrStream->getFormat( Width, Height, InputFormat, FrameRate ); if( m_pCurrStream->guessFormat( cFilename, Width, Height, InputFormat, FrameRate ) || bForceDialog ) { @@ -152,6 +143,16 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) QApplication::setOverrideCursor( Qt::WaitCursor ); QApplication::restoreOverrideCursor(); + if( !m_pCurrStream ) + { + m_pCurrStream = new PlaYUVerStream; + } + else + { + delete m_pCurrStream; + m_pCurrStream = new PlaYUVerStream; + } + m_pCurrStream->open( cFilename, Width, Height, InputFormat, FrameRate ); m_sStreamInfo.m_cFilename = cFilename;