Fixed: fixed black screen when pulling playhead back.
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2022 Olive Team
|
||||
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team
|
||||
Modifications Copyright (C) 2025 mikesolar
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -152,7 +152,28 @@ static void ApplyParamOverrides(OFX::Host::ImageEffect::Instance &instance,
|
||||
if (auto *param =
|
||||
dynamic_cast<OFX::Host::Param::DoubleInstance *>(
|
||||
entry.second)) {
|
||||
param->set(time, value.data().toDouble());
|
||||
double v = value.data().toDouble();
|
||||
if (std::isnan(v) || std::isinf(v)) {
|
||||
qWarning() << "[PLUGIN] NaN/Inf in double param" << key
|
||||
<< "replacing with default";
|
||||
auto *default_prop =
|
||||
entry.second->getProperties().fetchDoubleProperty(
|
||||
kOfxParamPropDefault);
|
||||
v = default_prop ? default_prop->getValue() : 0.0;
|
||||
}
|
||||
auto *min_prop =
|
||||
entry.second->getProperties().fetchDoubleProperty(
|
||||
kOfxParamPropMin);
|
||||
if (min_prop && v < min_prop->getValue()) {
|
||||
v = min_prop->getValue();
|
||||
}
|
||||
auto *max_prop =
|
||||
entry.second->getProperties().fetchDoubleProperty(
|
||||
kOfxParamPropMax);
|
||||
if (max_prop && v > max_prop->getValue()) {
|
||||
v = max_prop->getValue();
|
||||
}
|
||||
param->set(time, v);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -1694,10 +1715,6 @@ void olive::plugin::PluginRenderer::RenderPlugin(TexturePtr src, olive::plugin::
|
||||
|
||||
// render a frame
|
||||
const char *render_field = GetRenderFieldForParams(output_params);
|
||||
qDebug() << "[PLUGIN] RenderPlugin use_opengl=" << use_opengl
|
||||
<< "time=" << frame
|
||||
<< "plugin=" << PluginIdForInstance(instance)
|
||||
<< "dest_valid=" << (destination ? destination->id().isValid() : false);
|
||||
stat = instance->renderAction(frame, render_field, renderWindow, renderScale,
|
||||
true, interactive, interactive);
|
||||
if (stat != kOfxStatOK && stat != kOfxStatReplyDefault) {
|
||||
@@ -1750,7 +1767,6 @@ void olive::plugin::PluginRenderer::RenderPlugin(TexturePtr src, olive::plugin::
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << "[PLUGIN] output_image black=" << img_black << "plugin=" << PluginIdForInstance(instance);
|
||||
} else {
|
||||
if (!destination || !destination->id().isValid()) {
|
||||
#ifdef OFX_SUPPORTS_OPENGLRENDER
|
||||
@@ -1796,7 +1812,6 @@ void olive::plugin::PluginRenderer::RenderPlugin(TexturePtr src, olive::plugin::
|
||||
} else {
|
||||
// OpenGL path: plugin has already rendered directly into the destination
|
||||
// texture via FBO/GL. No CPU readback or conversion needed.
|
||||
qDebug() << "[PLUGIN] OpenGL path done, returning directly";
|
||||
#ifdef OFX_SUPPORTS_OPENGLRENDER
|
||||
DetachOutputTexture();
|
||||
instance->contextDetachedAction();
|
||||
|
||||
@@ -162,8 +162,6 @@ FramePtr RenderProcessor::GenerateFrame(TexturePtr texture,
|
||||
break;
|
||||
}
|
||||
}
|
||||
qDebug() << "[RENDER] GenerateFrame DownloadFromTexture all_black="
|
||||
<< all_black << "total_bytes=" << total_bytes;
|
||||
}
|
||||
|
||||
return frame;
|
||||
@@ -209,9 +207,6 @@ void RenderProcessor::Run()
|
||||
}
|
||||
|
||||
TexturePtr texture = GenerateTexture(time, frame_length);
|
||||
qDebug() << "[RENDER] GenerateTexture time=" << time.toDouble()
|
||||
<< "tex_null=" << (texture == nullptr)
|
||||
<< "tex_dummy=" << (texture ? texture->IsDummy() : true);
|
||||
|
||||
if (!render_ctx_) {
|
||||
ticket_->Finish();
|
||||
@@ -269,7 +264,6 @@ void RenderProcessor::Run()
|
||||
}
|
||||
|
||||
render_ctx_->Flush();
|
||||
qDebug() << "[RENDER] Finishing with texture";
|
||||
ticket_->Finish(QVariant::fromValue(texture));
|
||||
} else {
|
||||
ticket_->Finish(QVariant::fromValue(frame));
|
||||
|
||||
Reference in New Issue
Block a user