nodes: fixed hashing issues
This commit is contained in:
@@ -69,7 +69,7 @@ void PreviewAutoCacher::GenerateHashes(ViewerOutput *viewer, FrameHashCache* cac
|
||||
|
||||
foreach (const rational& time, times) {
|
||||
// See if hash already exists in disk cache
|
||||
QByteArray hash = RenderManager::Hash(viewer->GetConnectedNode(ViewerOutput::kTextureInput), viewer->GetVideoParams(), time);
|
||||
QByteArray hash = RenderManager::Hash(viewer->GetConnectedTextureOutput(), viewer->GetVideoParams(), time);
|
||||
|
||||
// Check memory list since disk checking is slow
|
||||
bool hash_exists = (std::find(existing_hashes.begin(), existing_hashes.end(), hash) != existing_hashes.end());
|
||||
|
||||
@@ -79,7 +79,7 @@ RenderManager::~RenderManager()
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray RenderManager::Hash(const Node *n, const VideoParams ¶ms, const rational &time)
|
||||
QByteArray RenderManager::Hash(const Node *n, const QString& output, const VideoParams ¶ms, const rational &time)
|
||||
{
|
||||
QCryptographicHash hasher(QCryptographicHash::Sha1);
|
||||
|
||||
@@ -93,7 +93,7 @@ QByteArray RenderManager::Hash(const Node *n, const VideoParams ¶ms, const r
|
||||
hasher.addData(reinterpret_cast<const char*>(&format), sizeof(VideoParams::Format));
|
||||
|
||||
if (n) {
|
||||
n->Hash(Node::kDefaultOutput, hasher, time);
|
||||
n->Hash(output, hasher, time);
|
||||
}
|
||||
|
||||
return hasher.result();
|
||||
|
||||
@@ -67,7 +67,11 @@ public:
|
||||
/**
|
||||
* @brief Generate a unique identifier for a certain node at a certain time
|
||||
*/
|
||||
static QByteArray Hash(const Node *n, const VideoParams ¶ms, const rational &time);
|
||||
static QByteArray Hash(const Node *n, const QString &output, const VideoParams ¶ms, const rational &time);
|
||||
static QByteArray Hash(const NodeOutput &output, const VideoParams ¶ms, const rational &time)
|
||||
{
|
||||
return Hash(output.node(), output.output(), params, time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Asynchronously generate a frame at a given time
|
||||
|
||||
Reference in New Issue
Block a user