some improvements to nodes

This commit is contained in:
itsmattkc
2019-09-11 01:33:57 +10:00
parent a7744f15a7
commit 3f5f79a8c7
2 changed files with 10 additions and 4 deletions
+6 -1
View File
@@ -105,7 +105,12 @@ void MediaInput::Hash(QCryptographicHash *hash, NodeOutput *from, const rational
Node::Hash(hash, from, time);
// Use frame value from Decoder
if (from == texture_output_ && SetupDecoder()) {
if (from == texture_output_) {
if (!SetupDecoder()) {
qDebug() << "Failed to setup decoder for hashing";
return;
}
int64_t timestamp = decoder_->GetTimestampFromTime(time);
qDebug() << "Hashed timestamp" << timestamp;
+4 -3
View File
@@ -47,11 +47,12 @@ void NodeOutput::set_data_type(const NodeParam::DataType &type)
// If this output is connected to other inputs, check if they're compatible with this new data type
if (IsConnected()) {
foreach (NodeEdgePtr edge, edges_) {
for (int i=0;i<edges_.size();i++) {
NodeEdgePtr edge = edges_.at(i);
if (!AreDataTypesCompatible(this, edge->input())) {
// FIXME: Possible array out of bounds since this function removes edges while we're iterating through them?
// I'm not sure how Qt's `foreach` works.
DisconnectEdge(edge);
i--;
}
}
}