summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfred <fred@home.lan>2011-04-08 12:46:38 (GMT)
committer fred <fred@home.lan>2011-04-08 12:46:38 (GMT)
commitaf2f15ae15be9d0958eaec044ccfee39c12a4a4e (patch)
tree37d84f19783d6b9cb0f5f696435f64cabf9c3686
parent0714ec4de4d5592d20e446d7147413f30f768642 (diff)
modified remaining fps rate declaration from int to float
- In FPS::FPS and destructor, commented out the mutex creation.
-rw-r--r--src/fps.cpp14
-rw-r--r--src/include/context.h2
-rw-r--r--src/include/fps.h4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/fps.cpp b/src/fps.cpp
index 289051b..a7ea0e3 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 1626e50..bb78272 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 1338a91..4286694 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;
};