From af2f15ae15be9d0958eaec044ccfee39c12a4a4e Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 8 Apr 2011 14:46:38 +0200 Subject: [PATCH] modified remaining fps rate declaration from int to float - In FPS::FPS and destructor, commented out the mutex creation. --- src/fps.cpp | 14 +++++++------- src/include/context.h | 2 +- src/include/fps.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/fps.cpp b/src/fps.cpp index 289051b4..a7ea0e3b 100644 --- a/src/fps.cpp +++ b/src/fps.cpp @@ -42,26 +42,26 @@ FPS::FPS() { wake_ts.tv_sec = wake_ts.tv_nsec = 0; - if(pthread_mutex_init (&_mutex,NULL) == -1) - error("error initializing POSIX thread feed mutex"); - if(pthread_cond_init (&_cond, NULL) == -1) - error("error initializing POSIX thread feed condtition"); +// if(pthread_mutex_init (&_mutex,NULL) == -1) +// error("error initializing POSIX thread feed mutex"); +// if(pthread_cond_init (&_cond, NULL) == -1) +// error("error initializing POSIX thread feed condtition"); } FPS::~FPS() { free(fpsd.data); - if(pthread_mutex_destroy(&_mutex) == -1) +/* if(pthread_mutex_destroy(&_mutex) == -1) error("error destroying POSIX thread feed mutex"); if(pthread_cond_destroy(&_cond) == -1) - error("error destroying POSIX thread feed attribute"); + error("error destroying POSIX thread feed attribute");*/ } void FPS::init(float rate) { - this->set(25); + this->set(rate); for (int i=0; i<30; i++) { fpsd.data[i] = 0; diff --git a/src/include/context.h b/src/include/context.h index 1626e503..bb782729 100644 --- a/src/include/context.h +++ b/src/include/context.h @@ -164,7 +164,7 @@ class Context { /* Set the interval (in frames) after the fps counter is updated */ FPS fps; - int fps_speed; + float fps_speed; bool clear_all; bool start_running; diff --git a/src/include/fps.h b/src/include/fps.h index 1338a91e..4286694e 100644 --- a/src/include/fps.h +++ b/src/include/fps.h @@ -53,8 +53,8 @@ class FPS { struct timeval start_tv; /* mutex and conditional for the delay */ - pthread_mutex_t _mutex; - pthread_cond_t _cond; +// pthread_mutex_t _mutex; +// pthread_cond_t _cond; };