From: Helge Norberg Date: Fri, 7 Apr 2017 14:02:28 +0000 (+0200) Subject: [layer_producer] Return the last known framerate when channel has been destroyed. X-Git-Tag: 2.1.0_Beta2~7 X-Git-Url: https://git.sesse.net/?p=casparcg;a=commitdiff_plain;h=515b113d16afe4f0537e600a80a36483b996b016 [layer_producer] Return the last known framerate when channel has been destroyed. --- 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_; } };