footageviewer: ensure footage is set to nullptr when disconnecting and update stack

This commit is contained in:
itsmattkc
2020-10-11 23:39:55 +11:00
parent 9d9b25dc11
commit 3b6ebb6e30
2 changed files with 10 additions and 1 deletions
+3
View File
@@ -57,6 +57,9 @@ void FootageViewerWidget::SetFootage(Footage *footage)
ConnectViewerNode(nullptr);
video_node_->SetFootage(nullptr);
audio_node_->SetFootage(nullptr);
NodeParam::DisconnectEdge(video_node_->output(), sequence_.viewer_output()->texture_input());
NodeParam::DisconnectEdge(audio_node_->output(), sequence_.viewer_output()->samples_input());
}
+7 -1
View File
@@ -242,6 +242,9 @@ void ViewerWidget::DisconnectNodeInternal(ViewerOutput *n)
waveform_view_->SetViewer(nullptr);
waveform_view_->ConnectTimelinePoints(nullptr);
// Queue an UpdateStack so that when it runs, the viewer node will be fully disconnected
QMetaObject::invokeMethod(this, "UpdateStack", Qt::QueuedConnection);
}
void ViewerWidget::ConnectedNodeChanged(ViewerOutput *n)
@@ -687,7 +690,10 @@ void ViewerWidget::UpdateStack()
} else {
// Otherwise show regular display
stack_->setCurrentWidget(sizer_);
new_tb = GetConnectedNode()->video_params().time_base();
if (GetConnectedNode()) {
new_tb = GetConnectedNode()->video_params().time_base();
}
}
if (new_tb != timebase()) {