viewer: re-queue video renderer even when beyond the length
Ensures video renderer always renders where the playhead is.
This commit is contained in:
@@ -165,7 +165,7 @@ VideoRenderFrameCache *VideoRenderBackend::frame_cache()
|
||||
|
||||
QString VideoRenderBackend::GetCachedFrame(const rational &time)
|
||||
{
|
||||
last_time_requested_ = time;
|
||||
UpdateLastRequestedTime(time);
|
||||
|
||||
if (viewer_node() == nullptr) {
|
||||
// Nothing is connected - nothing to show or render
|
||||
@@ -182,8 +182,6 @@ QString VideoRenderBackend::GetCachedFrame(const rational &time)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Requeue();
|
||||
|
||||
// Find frame in map
|
||||
QByteArray frame_hash = frame_cache_.TimeToHash(time);
|
||||
|
||||
@@ -196,6 +194,13 @@ QString VideoRenderBackend::GetCachedFrame(const rational &time)
|
||||
return QString();
|
||||
}
|
||||
|
||||
void VideoRenderBackend::UpdateLastRequestedTime(const rational &time)
|
||||
{
|
||||
last_time_requested_ = time;
|
||||
|
||||
Requeue();
|
||||
}
|
||||
|
||||
NodeInput *VideoRenderBackend::GetDependentInput()
|
||||
{
|
||||
return viewer_node()->texture_input();
|
||||
|
||||
@@ -66,6 +66,8 @@ public:
|
||||
|
||||
QString GetCachedFrame(const rational& time);
|
||||
|
||||
void UpdateLastRequestedTime(const rational& time);
|
||||
|
||||
VideoRenderFrameCache* frame_cache();
|
||||
|
||||
const VideoRenderingParams& params() const;
|
||||
|
||||
@@ -320,6 +320,7 @@ void ViewerWidget::UpdateTextureFromNode(const rational& time)
|
||||
{
|
||||
if (!GetConnectedNode() || time >= GetConnectedNode()->Length()) {
|
||||
main_gl_widget()->SetImage(QString());
|
||||
video_renderer_->UpdateLastRequestedTime(time);
|
||||
} else {
|
||||
QString frame_fn = video_renderer_->GetCachedFrame(time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user