footageviewer: fix infinite loop
Also adds warning to help prevent this from happening again
This commit is contained in:
@@ -291,6 +291,10 @@ TimeRangeListFrameIterator::TimeRangeListFrameIterator(const TimeRangeList &list
|
||||
index_(-1),
|
||||
size_(-1)
|
||||
{
|
||||
if (!list_.isEmpty() && timebase_.isNull()) {
|
||||
qCritical() << "TimeRangeListFrameIterator created with null timebase but non-empty list, this will likely lead to infinite loops";
|
||||
}
|
||||
|
||||
UpdateIndexIfNecessary();
|
||||
}
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ void PreviewAutoCacher::TryRender()
|
||||
|
||||
// If we're here, we must be able to render
|
||||
if (!invalidated_video_.isEmpty()) {
|
||||
hash_iterator_ = TimeRangeListFrameIterator(invalidated_video_, viewer_node_->video_frame_cache()->GetTimebase());
|
||||
hash_iterator_ = TimeRangeListFrameIterator(invalidated_video_, viewer_node_->GetVideoParams().frame_rate_as_time_base());
|
||||
|
||||
for (int i=0; i<QThread::idealThreadCount(); i++) {
|
||||
QueueNextHashTask();
|
||||
|
||||
Reference in New Issue
Block a user