Fix preload function

This commit is contained in:
jfmcarreira committed 2015-03-02 18:18:09 +00:00
1 parent 9bcaa8f23d
commit aeff53ed1d
4 files changed
+16 -7

No files matched your search

+6
View File
@@ -109,6 +109,12 @@ VideoSubWindow::~VideoSubWindow()
delete m_pCurrStream;
}
Void VideoSubWindow::loadAll()
{
m_pCurrStream->loadAll();
refreshFrame();
}
Void VideoSubWindow::reloadFile()
{
Int currFrameNum = m_pCurrStream->getCurrFrameNum();
+1
View File
@@ -104,6 +104,7 @@ public:
Bool loadFile( QString cFilename, Bool bForceDialog = false );
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
Void loadAll( );
Void reloadFile();
Bool save( QString filename );
+1 -1
View File
@@ -357,7 +357,7 @@ Void plaYUVerApp::loadAll()
if( m_pcCurrentVideoSubWindow )
{
statusBar()->showMessage( tr( "Loading file into memory ..." ) );
m_pcCurrentVideoSubWindow->getInputStream()->loadAll();
m_pcCurrentVideoSubWindow->loadAll();
statusBar()->showMessage( tr( "File loaded" ), 2000 );
}
}
+8 -6
View File
@@ -441,14 +441,16 @@ Void PlaYUVerStream::loadAll()
m_pcCurrFrame = m_ppcFrameBuffer[m_uiFrameBufferIndex];
m_iCurrFrameNum = -1;
seekInput( 0 );
setNextFrame();
for( UInt i = m_uiFrameBufferIndex; i < m_uiFrameBufferSize; i++ )
for( UInt i = m_uiFrameBufferIndex + 1; i < m_uiFrameBufferSize; i++ )
{
m_pcNextFrame = m_ppcFrameBuffer[i];
readFrame();
setNextFrame();
}
m_bLoadAll = true;
seekInput( 0 );
m_uiFrameBufferIndex = 0;
m_pcNextFrame = m_ppcFrameBuffer[m_uiFrameBufferIndex];
m_iCurrFrameNum = -1;
setNextFrame();
}
Void PlaYUVerStream::getDuration( Int* duration_array )
@@ -475,10 +477,10 @@ Void PlaYUVerStream::getDuration( Int* duration_array )
Void PlaYUVerStream::readFrame()
{
if( !m_bInit || !m_bIsInput )
if( !m_bInit || !m_bIsInput || m_bLoadAll )
return;
if( ( m_iCurrFrameNum + ( m_uiFrameBufferSize - 1 ) >= ( Int64 )m_uiTotalFrameNum ) || m_bLoadAll )
if( ( m_iCurrFrameNum + ( m_uiFrameBufferSize - 1 ) >= ( Int64 )m_uiTotalFrameNum ) )
{
m_pcNextFrame = NULL;
return;