Fix problems with lock play and seek events

This commit is contained in:
jfmcarreira committed 2014-06-14 19:11:26 +01:00
1 parent fca35fc3a6
commit 9829db162e
4 files changed
+41 -22

No files matched your search

+4 -4
View File
@@ -191,6 +191,7 @@ Bool InputStream::open( QString filename, UInt width, UInt height, Int input_for
m_cStreamInformationString.append( "] " );
m_cStreamInformationString.append( QFileInfo( m_cFilename ).fileName() );
m_iCurrFrameNum = -1;
seekInput( 0 );
m_cTimer.start();
@@ -319,7 +320,7 @@ Void InputStream::readNextFrame()
UInt64 bytes_read = 0;
//m_cTimer.restart();
if( m_iCurrFrameNum + 1 >= ( Int )m_uiTotalFrameNum )
if( m_iCurrFrameNum + 1 >= (Int64)m_uiTotalFrameNum )
{
m_iErrorStatus = LAST_FRAME;
m_pcNextFrame = NULL;
@@ -370,8 +371,7 @@ Void InputStream::setNextFrame()
else
{
m_iErrorStatus = END_OF_SEQ;
m_iCurrFrameNum = 0;
seekInput( m_iCurrFrameNum );
seekInput( 0 );
}
}
@@ -393,7 +393,7 @@ Void InputStream::seekInput( UInt64 new_frame_num )
{
if( !m_pFile )
return;
if( new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum )
if( new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || (Int64)new_frame_num == m_iCurrFrameNum )
return;
#ifdef USE_FFMPEG
if( m_cLibAvContext.getStatus() )