From 3f5f79a8c7f4de36f68056f1771f526edce6b294 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 11 Sep 2019 01:33:57 +1000 Subject: [PATCH] some improvements to nodes --- app/node/input/media/media.cpp | 7 ++++++- app/node/output.cpp | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/node/input/media/media.cpp b/app/node/input/media/media.cpp index 37c6511d0..47e53745a 100644 --- a/app/node/input/media/media.cpp +++ b/app/node/input/media/media.cpp @@ -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; diff --git a/app/node/output.cpp b/app/node/output.cpp index 0d33ffb93..77375782c 100644 --- a/app/node/output.cpp +++ b/app/node/output.cpp @@ -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;iinput())) { - // 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--; } } }