Check if the stream was really seek

This commit is contained in:
2014-10-21 01:13:52 +01:00
parent 44e524ecb7
commit e8d4f15012
3 changed files with 13 additions and 8 deletions
+8 -4
View File
@@ -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();
}
}
}
+4 -3
View File
@@ -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 )
+1 -1
View File
@@ -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 );