From cc01ca58c0f9ad40ad3a2eeffa3a9abf6b274fd3 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 26 Jun 2014 02:49:13 +0100 Subject: [PATCH] Change format name --- source/lib/PlaYUVerStream.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/lib/PlaYUVerStream.cpp b/source/lib/PlaYUVerStream.cpp index 821a121..8eb45e7 100644 --- a/source/lib/PlaYUVerStream.cpp +++ b/source/lib/PlaYUVerStream.cpp @@ -86,7 +86,7 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_ if( m_bIsInput ) { - m_iFileFormat = YUVINPUT; + m_iFileFormat = INVALID_INPUT; QStringList formatsExt = PlaYUVerStream::supportedReadFormatsExt(); QString currExt = QFileInfo( filename ).suffix(); @@ -94,6 +94,12 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_ { m_iFileFormat = formatsExt.indexOf( currExt ); } + if( m_iFileFormat == INVALID_INPUT ) + { + close(); + return m_bInit; + } + m_cFormatName = PlaYUVerStream::supportedReadFormatsExt().at( m_iFileFormat ).toUpper(); m_iPixelFormat = input_format; @@ -101,7 +107,6 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_ if( m_iFileFormat != YUVINPUT ) { avStatus = m_cLibAvContext->initAvFormat( m_cFilename.toLocal8Bit().data(), m_uiWidth, m_uiHeight, m_iPixelFormat, m_uiFrameRate, m_uiTotalFrameNum ); - m_cFormatName = QFileInfo( filename ).completeSuffix().toUpper(); m_cCodedName = QString::fromUtf8( m_cLibAvContext->getCodecName() ).toUpper(); } #endif