From fefe31fcbbf6e0ace951622576278ab990cf7743 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 19 Aug 2019 15:46:29 +0300
Subject: [PATCH] Correct default fps setting

---
 components/common/cpp/src/configuration.cpp        | 2 +-
 components/rgbd-sources/include/ftl/rgbd/group.hpp | 2 +-
 components/rgbd-sources/src/group.cpp              | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp
index 786c07e5f..ef33ab93a 100644
--- a/components/common/cpp/src/configuration.cpp
+++ b/components/common/cpp/src/configuration.cpp
@@ -517,7 +517,7 @@ Configurable *ftl::config::configure(int argc, char **argv, const std::string &r
 	});
 
 	// Some global settings
-	ftl::timer::setInterval(rootcfg->value("fps",20));
+	ftl::timer::setInterval(1000 / rootcfg->value("fps",20));
 
 	int pool_size = rootcfg->value("thread_pool_factor", 2.0f)*std::thread::hardware_concurrency();
 	if (pool_size != ftl::pool.size()) ftl::pool.resize(pool_size);
diff --git a/components/rgbd-sources/include/ftl/rgbd/group.hpp b/components/rgbd-sources/include/ftl/rgbd/group.hpp
index 8f1dd61a6..35b3640cf 100644
--- a/components/rgbd-sources/include/ftl/rgbd/group.hpp
+++ b/components/rgbd-sources/include/ftl/rgbd/group.hpp
@@ -78,7 +78,7 @@ class Group {
 
 	/** To be deprecated in favour of ftl::timer::setInterval.
 	 */
-	void setFPS(int fps);
+	//void setFPS(int fps);
 
 	/**
 	 * Set the minimum number of frames latency. The latency is from the most
diff --git a/components/rgbd-sources/src/group.cpp b/components/rgbd-sources/src/group.cpp
index 1d700e108..af8dd00e1 100644
--- a/components/rgbd-sources/src/group.cpp
+++ b/components/rgbd-sources/src/group.cpp
@@ -38,10 +38,10 @@ Group::~Group() {
 	}
 }
 
-void Group::setFPS(int fps) {
-	mspf_ = 1000 / fps;
-	ftl::timer::setInterval(mspf_);
-}
+//void Group::setFPS(int fps) {
+//	mspf_ = 1000 / fps;
+//	ftl::timer::setInterval(mspf_);
+//}
 
 void Group::addSource(ftl::rgbd::Source *src) {
 	UNIQUE_LOCK(mutex_, lk);
-- 
GitLab