Closed ilia3101 closed 2 years ago
For me there is no infinite loop.
Did you try opening it along with another file?
Here, I select two files, one is this file, the other is just a random MLV without issues (from a different day and a different camera, can be anything), and I try to open them both at the same time:
I'm using MLV App 1.13 official release for macos.
Okay. I see. The problem comes to life with minimum 2 invalid clips. It happens in MainWindow.cpp:
int MainWindow::showFileInEditor(int row)
{
if( SESSION_CLIP_COUNT <= 0 ) return 1;
//Stop Playback
ui->actionPlay->setChecked( false );
//Save slider receipt
if( !ACTIVE_RECEIPT->wasNeverLoaded() && !m_inClipDeleteProcess ) setReceipt( ACTIVE_RECEIPT );
//Save new position in session
int oldActive = SESSION_ACTIVE_CLIP_ROW;
SET_ACTIVE_CLIP_IDX( row );
//Open new MLV
if( openMlv( GET_CLIP( row )->getPath() ) )
{
//If one file is selected, reselect the last one, else do nothing (export)
//And if there is another file we can switch to...
if( selectedClipsList().count() <= 1
&& SESSION_CLIP_COUNT > 1)
{
m_pSelectionModel->setCurrentIndex( m_pProxyModel->mapFromSource( m_pModel->index( oldActive, 0, QModelIndex() ) ), QItemSelectionModel::ClearAndSelect );
showFileInEditor( oldActive );
}
return 1;
}
oldActive should be loaded by showFileInEditor function and becomes recursive, if a 2nd file is also invalid. We should save somehow, if a clip was loaded successfully at least once before - if not we should stop this behavior.
Could you try this please? 5c6a87cb49bb49d83bba1be28851831d7ea7865d For me this stops the loop after a few messages. But removing files still just works when importing one invalid file. The algorithm seems to fail if no valid file opened and still importing more invalid files.
Thanks for the fix, will try this out. Reporting back soon.
Can confirm, no more infinte loop. The window appears a couple of times.
I think this can be closed, as my core issue is fixed.
Try opening this file at the same time as opening other files (selecting a few in finder, and opening all at once), I don't know why I have files like this but I'm finding them in various places:
M02-1622.MLV.zip
I think this bug also happens when a file gets deleted or moved on disk but is still in the session and you try to click on it again in the session.
Probably the same control flow issue causes all these infinite loops?