diff --git a/CMakeLists.txt b/CMakeLists.txt index 6951935..545c6b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ OPTION( PLAYUVER_LONGVERSIONNAME "Use long version name in deb" OFF ) OPTION( PLAYUVER_WERROR "Warnings as errors" OFF ) OPTION( PLAYUVER_THREADED_MODULES "Use threads for modules" OFF ) OPTION( USE_QT4 "Build with QT4" OFF ) -OPTION( USE_SSE "Build with SSE support" OFF ) +OPTION( USE_SSE "Build with SSE support" OFF ) ##################################################################################### # Qt library diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index 558c4b5..e374e2f 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -145,6 +145,7 @@ PlaYUVerStream::PlaYUVerStream() m_ppcFrameBuffer = NULL; m_uiFrameBufferSize = 2; m_uiFrameBufferIndex = 0; + m_uiCurrFrameFileIdx = 0; #ifdef USE_FFMPEG m_cLibAvContext = new LibAvContextHandle; #endif @@ -480,7 +481,7 @@ Void PlaYUVerStream::readFrame() if( !m_bInit || !m_bIsInput || m_bLoadAll ) return; - if( ( m_iCurrFrameNum + ( m_uiFrameBufferSize - 1 ) >= ( Int64 )m_uiTotalFrameNum ) ) + if( m_uiCurrFrameFileIdx >= Int64( m_uiTotalFrameNum ) ) { m_pcNextFrame = NULL; return; @@ -508,6 +509,7 @@ Void PlaYUVerStream::readFrame() } m_pcNextFrame->frameFromBuffer( m_pStreamBuffer, bytes_read ); } + m_uiCurrFrameFileIdx++; m_pcNextFrame->fillRGBBuffer(); return; } @@ -662,6 +664,7 @@ Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) } m_uiFrameBufferIndex = 0; m_pcCurrFrame = m_pcNextFrame = m_ppcFrameBuffer[m_uiFrameBufferIndex]; + m_uiCurrFrameFileIdx = 0; readFrame(); setNextFrame(); diff --git a/lib/PlaYUVerStream.h b/lib/PlaYUVerStream.h index 715cda1..f675dc2 100644 --- a/lib/PlaYUVerStream.h +++ b/lib/PlaYUVerStream.h @@ -84,6 +84,7 @@ private: PlaYUVerFrame *m_pcCurrFrame; PlaYUVerFrame *m_pcNextFrame; UInt m_uiFrameBufferIndex; + UInt64 m_uiCurrFrameFileIdx; UInt m_uiWidth; UInt m_uiHeight;