fixed precache task

Fixes #1558
This commit is contained in:
itsmattkc
2021-04-11 18:57:21 +10:00
parent 6c30f8cf46
commit a87adbd801
5 changed files with 30 additions and 27 deletions
+11 -7
View File
@@ -490,15 +490,19 @@ void ProjectExplorer::ContextMenuStartProxy(QAction *a)
Sequence* sequence = Node::ValueToPtr<Sequence>(a->data());
// To get here, the `context_menu_items_` must be all kFootage
foreach (Node* i, context_menu_items_) {
Footage* f = static_cast<Footage*>(i);
foreach (Node* item, context_menu_items_) {
Footage* f = static_cast<Footage*>(item);
QVector<VideoParams> enabled_streams = f->GetEnabledVideoStreams();
int sz = f->InputArraySize(Footage::kVideoParamsInput);
foreach (const VideoParams& stream, enabled_streams) {
// Start a background task for proxying
PreCacheTask* proxy_task = new PreCacheTask(f, stream.stream_index(), sequence);
TaskManager::instance()->AddTask(proxy_task);
for (int j=0; j<sz; j++) {
VideoParams vp = f->GetVideoParams(j);
if (vp.enabled()) {
// Start a background task for proxying
PreCacheTask* proxy_task = new PreCacheTask(f, j, sequence);
TaskManager::instance()->AddTask(proxy_task);
}
}
}
}