diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 1cda5b00..782b2519 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -743,8 +743,10 @@ class Exception : public std::exception virtual ~Exception() noexcept = default; CLASS_COPY_MOVE_DEFAULT( Exception ) - virtual const char* what() const noexcept { return m_str.c_str(); } - template Exception& operator<<( const T& t ) { std::ostringstream oss; oss << t; m_str += oss.str(); return *this; } + virtual const char* what() const noexcept { return m_str.c_str(); } + template + inline Exception& operator<<( const T& t ) { std::ostringstream oss; oss << t; m_str += oss.str(); return *this; } + private: std::string m_str; }; @@ -755,6 +757,9 @@ class RecoverableException : public Exception explicit RecoverableException( const std::string& _s ) : Exception( _s ) {} virtual ~RecoverableException() noexcept = default; CLASS_COPY_MOVE_DEFAULT( RecoverableException ) + + template + inline RecoverableException& operator<<( const T& t ) { static_cast( *this ) << t; return *this; } }; class UnsupportedFeatureException : public Exception @@ -763,6 +768,9 @@ class UnsupportedFeatureException : public Exception explicit UnsupportedFeatureException( const std::string& _s ) : Exception( _s ) {} virtual ~UnsupportedFeatureException() noexcept = default; CLASS_COPY_MOVE_DEFAULT( UnsupportedFeatureException ) + + template + inline UnsupportedFeatureException& operator<<( const T& t ) { static_cast( *this ) << t; return *this; } }; #if defined( __MINGW32__ ) && !defined( __MINGW64__ ) diff --git a/source/Lib/DecoderLib/DecLibParser.cpp b/source/Lib/DecoderLib/DecLibParser.cpp index 2f893d7e..2fff9b86 100644 --- a/source/Lib/DecoderLib/DecLibParser.cpp +++ b/source/Lib/DecoderLib/DecLibParser.cpp @@ -247,7 +247,7 @@ bool DecLibParser::parse( InputNALUnit& nalu ) const VPS* vps = m_parameterSetManager.getVPS( sps->getVPSId() ); m_seiReader.parseSEImessage( &( nalu.getBitstream() ), m_pcParsePic->seiMessageList, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream ); - if( m_parseFrameDelay == 0 ) // else it has to be done in finishPicture() + if( m_parseFrameDelay == 0 && !m_pcParsePic->error ) // if m_parseFrameDelay > 0, it has to be done in finishPicture() { // if parallel parsing is disabled, wait for the picture to finish if( m_threadPool->numThreads() == 0 )