diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 797bdd9..ba1cd71 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -32,6 +32,8 @@ #include +#define QT_NO_CONCURRENT + /** * \brief Functions to control data stream from stream information */ diff --git a/lib/CalypStream.cpp b/lib/CalypStream.cpp index 8f685fb..1dd4d07 100644 --- a/lib/CalypStream.cpp +++ b/lib/CalypStream.cpp @@ -155,10 +155,10 @@ struct CalypStreamPrivate CalypStreamPrivate() { - isInit = false; - pfctCreateHandler = NULL; handler = NULL; + pfctCreateHandler = NULL; isInput = true; + isInit = false; bLoadAll = false; iCurrFrameNum = -1; cFilename = ""; diff --git a/lib/CalypStreamHandlerIf.h b/lib/CalypStreamHandlerIf.h index 1a07dcc..4259737 100644 --- a/lib/CalypStreamHandlerIf.h +++ b/lib/CalypStreamHandlerIf.h @@ -80,6 +80,7 @@ public: , m_uiTotalNumberFrames( 0 ) , m_pStreamBuffer( NULL ) , m_uiNBytesPerFrame( 0 ) + , m_isEOF( false ) { } virtual ~CalypStreamHandlerIf() {} @@ -115,6 +116,7 @@ protected: unsigned long m_uiTotalNumberFrames; ClpByte* m_pStreamBuffer; unsigned long m_uiNBytesPerFrame; + bool m_isEOF; }; #endif // __CALYPSTREAMHANDLERIF_H__ diff --git a/lib/StreamHandlerLibav.cpp b/lib/StreamHandlerLibav.cpp index a211e83..4a281c2 100644 --- a/lib/StreamHandlerLibav.cpp +++ b/lib/StreamHandlerLibav.cpp @@ -336,11 +336,12 @@ bool StreamHandlerLibav::configureBuffer( CalypFrame* pcFrame ) void StreamHandlerLibav::calculateFrameNumber() { unsigned long long int num_frames; - if( m_cStream->nb_frames ) + /*if( m_cStream->nb_frames ) { num_frames = m_cStream->nb_frames; } - else if( m_cFmtCtx->duration != AV_NOPTS_VALUE ) + else */ + if( m_cFmtCtx->duration != AV_NOPTS_VALUE ) { long long int duration = m_cFmtCtx->duration + 5000; m_uiSecs = duration / AV_TIME_BASE; @@ -371,6 +372,8 @@ bool StreamHandlerLibav::read( CalypFrame* pcFrame ) bReadPkt = true; else return false; + //if( iRet == AVERROR_EOF ) + // m_isEOF = true; } else { @@ -397,7 +400,14 @@ bool StreamHandlerLibav::read( CalypFrame* pcFrame ) bReadPkt = false; av_packet_unref( &m_cOrgPacket ); if( ( iRet = av_read_frame( m_cFmtCtx, &m_cPacket ) ) < 0 ) + { + if( iRet == AVERROR_EOF ) + { + m_isEOF = true; + return true; + } return false; + } m_cOrgPacket = m_cPacket; #ifdef FF_SEND_RECEIVE_API if( m_cPacket.stream_index == m_iStreamIdx )