From 515b113d16afe4f0537e600a80a36483b996b016 Mon Sep 17 00:00:00 2001 From: Helge Norberg Date: Fri, 7 Apr 2017 16:02:28 +0200 Subject: [PATCH] [layer_producer] Return the last known framerate when channel has been destroyed. --- modules/reroute/producer/layer_producer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/reroute/producer/layer_producer.cpp b/modules/reroute/producer/layer_producer.cpp index 85af0ebd7..5e264cd29 100644 --- a/modules/reroute/producer/layer_producer.cpp +++ b/modules/reroute/producer/layer_producer.cpp @@ -144,6 +144,7 @@ class layer_producer : public core::frame_producer_base const spl::shared_ptr consumer_; core::draw_frame last_frame_; + mutable boost::rational last_frame_rate_; const std::weak_ptr channel_; core::constraints pixel_constraints_; @@ -242,11 +243,13 @@ public: auto channel = channel_.lock(); if (!channel) - return 1; + return last_frame_rate_; - return double_framerate_ + last_frame_rate_ = double_framerate_ ? channel->video_format_desc().framerate * 2 : channel->video_format_desc().framerate; + + return last_frame_rate_; } }; -- 2.39.2