diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index 6125d6d..87f91a4 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -303,8 +303,10 @@ Void SubWindowHandle::seekAbsoluteEvent( UInt new_frame_num ) { if( m_pCurrStream ) { - m_pCurrStream->seekInput( new_frame_num ); - refreshFrame(); + if( m_pCurrStream->seekInput( new_frame_num ) ) + { + refreshFrame(); + } } } @@ -312,8 +314,10 @@ Void SubWindowHandle::seekRelativeEvent( Bool bIsFoward ) { if( m_pCurrStream ) { - m_pCurrStream->seekInput( m_pCurrStream->getCurrFrameNum() + ( bIsFoward ? 1 : -1 ) ); - refreshFrame(); + if( m_pCurrStream->seekInput( m_pCurrStream->getCurrFrameNum() + ( bIsFoward ? 1 : -1 ) ) ) + { + refreshFrame(); + } } } diff --git a/source/lib/PlaYUVerStream.cpp b/source/lib/PlaYUVerStream.cpp index 0a68b19..8d06d41 100644 --- a/source/lib/PlaYUVerStream.cpp +++ b/source/lib/PlaYUVerStream.cpp @@ -644,10 +644,10 @@ PlaYUVerFrame* PlaYUVerStream::getCurrFrame() return m_pcCurrFrame; } -Void PlaYUVerStream::seekInput( UInt64 new_frame_num ) +Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) { if( !m_bInit || new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || ( Int64 )new_frame_num == m_iCurrFrameNum ) - return; + return false; m_iCurrFrameNum = new_frame_num - 1; @@ -656,7 +656,7 @@ Void PlaYUVerStream::seekInput( UInt64 new_frame_num ) m_uiFrameBufferIndex = new_frame_num; m_pcNextFrame = m_ppcFrameBuffer[m_uiFrameBufferIndex]; setNextFrame(); - return; + return true; } #ifdef USE_FFMPEG if( m_cLibAvContext->getStatus() ) @@ -677,6 +677,7 @@ Void PlaYUVerStream::seekInput( UInt64 new_frame_num ) setNextFrame(); if( m_uiTotalFrameNum > 1 ) readFrame(); + return true; } Bool PlaYUVerStream::checkErrors( Int error_type ) diff --git a/source/lib/PlaYUVerStream.h b/source/lib/PlaYUVerStream.h index 072da79..60f2f2b 100644 --- a/source/lib/PlaYUVerStream.h +++ b/source/lib/PlaYUVerStream.h @@ -253,7 +253,7 @@ public: PlaYUVerFrame* getCurrFrame(); PlaYUVerFrame* getCurrFrame( PlaYUVerFrame * ); - Void seekInput( UInt64 new_frame_num ); + Bool seekInput( UInt64 new_frame_num ); Bool checkErrors( Int error_type );