modified remaining fps rate declaration from int to float

- In FPS::FPS and destructor, commented out the mutex creation.
This commit is contained in:
fred
2011-04-08 14:46:38 +02:00
parent 0714ec4de4
commit af2f15ae15
3 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -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;
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;
};